terrain engine problems


I have written a terrain class, that displays a 3D patch of terrain (240x100x240 max. size) using triangle strips. The problem is, that the rendering function sometimes crashes with a division by zero exception, which is caused by the GL itself. (to be precise, by glVertex3f) I use a perspective projection (fov is 60 degrees, the clipping planes are 0.1 and 1000), and gluLookAt to move the camera. When the exception occurs, the camera is at (70,0001; 50,0; 85,0) looking at (10,0; 0,0; 25,0), and the upvector is (0,0; 1,0; 0,0). The vertex’s coordinates are (180; 20; 50) - this is being processed, when the program crashes. (I can write down the matrices too, if that helps.)


Hi there,

what compiler are you using??

i know if you are using some compilers
ie Borlands then you have to disable
floating point exceptions.

Hope it helps.


Yes, I am using a Borland C++ Builder 3. I’ll try disabling those exceptions.

Thank you for your help,