I'm creating a first-person camera that rotates using Euler angles. I created the view matrix for the camera like this:
Quaternionf rotation = new Quaternionf().rotateXYZ(
orientation.x,
orientation.y,
orientation.z
);
return new Matrix4f().rotate(rotation).translate(
-this.position.x,
-this.position.y,
-this.position.z);
where orientation is a Vector3f
of the Euler angles. How do I use the same rotation quaternion to move the camera position? And how do I get the view direction vector? I want to move the position of the camera from the view direction.
The math library I'm using is JOML, but it doesn't have a tag yet on StackOverflow.