Original Post
I've got some piece of code which makes and renders water on a plane, and everything works great. Except when I don't want the water plane at y=0. I've tried everything(well almost), searched the forums etc.. But I can't figure out how to make the reflection texture when it's at a different y than 0. Here's the code I use: The above code works great as long as the water plane is at y=0, but how do I make it work for any y?
glViewport(0, 0, textureSize, textureSize);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glLoadMatrix(camera.getModelViewMatrix());
glScalef(1.0f, -1.0f, 1.0f);
double[] clip = { 0.0, 1.0, 0.0, 0.0 };
glClipPlane(GL_CLIP_PLANE0, clip);
glEnable(GL_CLIP_PLANE0);
renderScene();
glDisable(GL_CLIP_PLANE0);
glPopMatrix();
// copy whatever in viewport to reflection texture
// etc...