I made my camera with lookat and I am a bit stuck.
I am following a tutorial on habib's site and he has code like this:
private Matrix reflectionViewMatrix; float reflectionCamZCoord = -cameraPosition.Z + 2*waterHeight; Vector3 reflectionCamPosition = new Vector3(cameraPosition.X, cameraPosition.Y, reflectionCamZCoord); float reflectionTargetZCoord = -targetPos.Z + 2 * waterHeight; Vector3 reflectionCamTarget = new Vector3(targetPos.X, targetPos.Y, reflectionTargetZCoord); Vector3 forwardVector = reflectionCamTarget - reflectionCamPosition; Vector3 sideVector = Vector3.Transform(new Vector3(1, 0, 0), cameraRotation); Vector3 reflectionCamUp = Vector3.Cross(sideVector, forwardVector); reflectionViewMatrix = Matrix.CreateLookAt(reflectionCamPosition, reflectionCamTarget, reflectionCamUp);
but I need something like that for OpenGL, the only things I know is the water Y value, the view matrix and the parameters that go into lookat function.
Can someone please help me