J
jtmx
Guest
Hello all,
I'm trying to create a 3D Camera in GMS2 that has Yaw, Pitch and Roll. I managed to get the Yaw and Pitch working however I can't seem to get the Roll working properly. Any help with this would be greatly appreciated.
Code:
I'm trying to create a 3D Camera in GMS2 that has Yaw, Pitch and Roll. I managed to get the Yaw and Pitch working however I can't seem to get the Roll working properly. Any help with this would be greatly appreciated.
Code:
Code:
if keyboard_check(ord("A"))
cam_yaw -= 10;
if keyboard_check(ord("D"))
cam_yaw += 10;
if keyboard_check(ord("W"))
cam_pitch -= 10;
if keyboard_check(ord("S"))
cam_pitch += 10;
if keyboard_check(ord("Q"))
cam_roll -= 10;
if keyboard_check(ord("E"))
cam_roll += 10;
cam_xto = dcos(cam_yaw) * dcos(cam_pitch);
cam_yto = dsin(cam_yaw) * dcos(cam_pitch);
cam_zto = dsin(cam_pitch);
cam_xup = dsin(cam_roll);
cam_yup = dcos(cam_roll);
cam_zup = dcos(cam_pitch);
matrix_build_lookat(x,y,z,x + cam_xto,y + cam_yto,z + cam_zto,cam_xup,cam_yup,cam_zup);