New answers tagged

1

It seems each time you call getHeight(x,z) you get different results, regardless of whether the (x,z) is the same or not, so the generated normals don't match the terrain surface. Normals will match the actual terrain if you compute them from the generated terrain, and not from what getHeight returns. However, it makes sense to also fix getHeight so it ...


0

You appear to be writing your vertices in a straight line. That is, vertex0 has position (0,0,0). vertex1 has position (-6,0,0). vertex2 has position (-12,0,0). vertex3 has position (-18,0,0), and so on. Once you've finished all 128 vertices along one strip, you move back to the start and then specify vertex128 (0,0,-6). (and then (-6,0,-6), ...



Top 50 recent answers are included