I'm trying to render water with reflection and refraction and I am new on OpenGL and I have stumbled upon a simple problem. I want for the reflection texture to move the camera down and invert it to capture the image. I have a Camera with quaternions and Yaw and Pitch. I thought to add roll also and rotate roll by 180 degrees to get the inversion but I can not manage to combine the 3 quaternions. Here is the update function of the camera :
void UpdateCameraVectors()
{
// Yaw
glm::quat aroundY = glm::angleAxis(glm::radians(-RightAngle), glm::vec3(0, 1, 0));
// Pitch
glm::quat aroundX = glm::angleAxis(glm::radians(UpAngle), glm::vec3(1, 0, 0));
// Roll
glm::quat aroundZ = glm::angleAxis(glm::radians(RollAngle), glm::vec3(0, 0, 1));
Orientation = aroundY * aroundX;
glm::quat qF = Orientation * glm::quat(0, 0, 0, -1) * glm::conjugate(Orientation);
Front = { qF.x, qF.y, qF.z };
Right = glm::normalize(glm::cross(Front, glm::vec3(0, 1, 0)));
}
Any suggestions on how to invert the view or how to combine the quaternions? I already tried all possible multiplications between them.