i have this trouble with making a first person camera i'm trying different ways that i find on google but i don't understand how to do it still here is how my camera class looks like
private Vector3f position = new Vector3f(0, 0, 0);
private float pitch;
private float yaw;
private float roll;
public Camera() {
Mouse.setGrabbed(true);
}
public void move() {
if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
position.x += (float) (Math.sin(Math.toRadians(rotY)) * 0.5);
}
if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
position.x += 0.05f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
position.x -= 0.05f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_S)) {
position.z += 0.05f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
position.y += 0.05f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
position.y -= 0.05f;
}
yaw += Mouse.getDX();
pitch += -Mouse.getDY();
}
public Vector3f getPosition() {
return position;
}
public float getPitch() {
return pitch;
}
public float getYaw() {
return yaw;
}
public float getRoll() {
return roll;
}
I calculate the rotation and stuff in another class called maths and i give it to the shaders to render but i don't know how to make it move in the direction of the pitch yaw.