PDA

View Full Version : Keeping Water Plane in same place



soconne
06-11-2004, 09:46 AM
I'm trying to keep a simple quad that is a water plane in the same place when you move around in the world. I do so with the following code when rendering the water

glGetFloatv(GL_MODELVIEW_MATRIX, mat);
mat[12]=mat[13]=mat[14]=0;
glLoadMatrixf(mat);

This gets rid of the camera translation but keeps the rotation. Now what I want to do is let the water be translated vertically, but that is it. What happens is whenever i look up or down, the entire water plane moves real fast up and down with me, its very odd. I tried not setting mat[13] to 0, but I get the same effect.

Anybody know how to solve this?

06-11-2004, 08:37 PM
an introduction to cameras, among other things
http://www.gametutorials.com/Tutorials/opengl/opengl_pg1.htm#Camera