#### Archived

This topic is now archived and is closed to further replies.

# rotations

This topic is 5895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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??

##### Share on other sites
Problems with Gimbal lock?
To get it right, rotate to the left/right first, then rotate up.

##### Share on other sites
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.

• 40
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631371
• Total Posts
2999610
×