rotations

Started by
1 comment, last by gotG 21 years, 11 months ago
im having a little prob with 3d rotation, i understand the concept and is familiar with the math its just i have a tiny implementation problem: I build a camera class the Camera is repersented by a 4x4 matrix it has the usual info in it such as the viewdirection, up, and right vectors into. i also can get the worldspace location of the camera. and infact theres nothing wrong with the math part. suppose i look up by Pi/4 in that case my direction vector is now 45 degrees off the xy plane,and my up vector being perpendicular to that vector is rotated back also by 45degrees, ok here comes the problem! when i want to apply another rotation at this point, say to the right/left. the view would pitch, since the up vector that iam rotating around is no longer 0,1,0. i i want the view to still rotate around the orignal up direction which in this case is the y-axis. But no matter how i try to rotate it the final transformation matrix always comes out as described above. can someone help??
Buckle your seatbelt Dorthy, cause Kansas is going bye bye!!!
Advertisement
Problems with Gimbal lock?
To get it right, rotate to the left/right first, then rotate up.
Another solution is to convert the camera orientation into angles (rotation and elevation) and work with those, and then calculate the up, right, and forward vectors only as you need them.

This topic is closed to new replies.

Advertisement