To learn 3d programming and the opengl api i have made a terraindemo which generates a terrain model with triangles.
All works fine but i need to do some optimizations because i fill the renderpipeline with all of the tousends of triangles per frame but only a few of them are seen. How to do a frustum view culling in opengl when i am in modelmatrix mode?
glTranslatef( - position,- position,-position );
glRotatef(rot, 1.0f, 0.0f, 0.0f); //roll
glRotatef(rot, 0.0f, 1.0f, 0.0f); //pitch
glRotatef(rot, 0.0f, 0.0f, 1.0f); //heading
here i have a terrain model with tousends of triangles.
how do i determine which triangles are visible?
how to set up the frustum planes and do a visibility test with the triangle vertices?
hope for any usefull hints.