RE: LDView 4.2 Released
2017-10-24, 9:17 (This post was last modified: 2017-10-24, 10:50 by Michael Horvath.)
2017-10-24, 9:17 (This post was last modified: 2017-10-24, 10:50 by Michael Horvath.)
(2017-10-24, 4:42)Travis Cobbs Wrote: I'm not sure it will work, but try calculating how far you need to rotate around X for Y to point straight up. Store this in deltaY. Rotate around X by that amount, then rotate around Y by the desired X rotation amount, then rotate around X by -deltaY + the desired Y rotation amount.
Note that the X and Y rotations above are inverted intentionally. If you want to turn your head left or right (X rotation amount), you rotate around the Y axis. If you want to nod your head up and down (Y rotation amount), you rotate around the X axis.
How do I determine the angle between the camera's orientation and the global "up" direction if the camera angles are always local? I'm assuming that "cameraXRotate" and "cameraYRotate" are just deltas and not cumulative amounts. I haven't figured out how to print or record the angles in VS yet for debugging purposes.