Why on earth would this happen (Look at picture)
The lines you see seemingly appear behind me from the point you can see them in the pic onward.
On the way back from the otherside, all you can see above you is some nasty spaces apart lines, it is super ugly...*** is going on.
The vertices MUST be getting listed incorrectly.
Scale = 1024, size = 128.
This is the code which generates the map you see
PHP Code:
bool Landscape::GenerateHeightMap(int size, int scale)
{
FILE *fp;
Segments[0].Size = size;
Segments[0].Scale = scale;
int Size = size;
int Scale = scale;
int idx=Segments[0].NumIndices;
for (y=0; y < Size-1; y++)
{
for (int x=0; x < Size-1; x++)
{
CurrVertex = y*(Size)+x;
Segments[0].Indices[idx--] = CurrVertex;
Segments[0].Indices[idx--] = CurrVertex+1;
Segments[0].Indices[idx--] = CurrVertex+(Size);
Segments[0].Indices[idx--] = CurrVertex+(Size)+1;
Segments[0].Indices[idx--] = CurrVertex+(Size);
Segments[0].Indices[idx--] = CurrVertex+1;
}
}
// we dont need the heightmap anymore, get rid of it
if (hmap) { delete hmap; hmap = NULL; }
return true;
}
Edit:
What type of draw method should I use? STRIP, LIST?
Notice how I am listing the indice backwards...If I don't, then I only seem every 2nd triangle on the terrain unless my camera is below the terrain then I see it all.....
That code is generating enough triangles for the top and bottom to be displayed. I only need to see the top...when the camera is above.
If I do a LINESTRIP it seems every vertice point runs a tangent to an infinite nowhere.
Last edited by Halsafar; Nov 28th, 2004 at 11:09 PM.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama