Height field question?

I have written a small app that imports height data and constructs a quadstrip height field, I colour all quads green(grass).

I wish to shade the terrain according to elevation(ie highest light green, lowest dark green).

I managed this once before using lighting, I entered the vertices coords as the normals then did something daft with the lighting and it worked although it was flat shaded. I can not seem to recreate this.

I have tried another approach using colours for each vertex instead of lighting, but there is a horrible banding which matches horizontally but not vertically(this is probaly because I am drawing a quadstrip across, then dropping directly down and drawing another until the height field is drawn.)

does anyone know where I can get some examples, or can help

Thanx.

Paul Sharp

Hmm…this answer may be very stupid but:
Why don´t you caculate proper vertex-normals
for your vertices instead of taking the vertices as normals?I see no serious problem then with the lighting.

HTH,XBTC!

Read my reply in the beginer forum

Have done gally!

Load of bollocks!

You cannot use a quad strip, because
four vertices will not be in the same plane.
Use a GL_TRIANGLE_STRIP !

I got it too work looks a bit blocky.

Why must I use triangles, please digess?

Why dont you use different colors for the vertices depending on height .
It works very good for me .
Scale the height position so it fits between 0.3 and 1.0 and set the color for each vertex in your height field .
This works great with texturized terrain .

Either use vertex colors, or use TexGen with a 1D texture and Z as your S texgen vector.

You all think ironduke is going to wait 1.5 years for another suggestion?

ironduke, are you still alive in the gl-forums? and if so, did you solfed your problem you had years ago? do you even remember the problem at all?

The iron duke died in 1852

No Im still here.

Cant remember if I fixed the problem tho