PDA

View Full Version : local camera coordinate system - help



pyramation
03-05-2010, 03:15 AM
Hello,

I am trying to emulate Maya's mouse interaction with the glutMouseFunc. I have gotten mouse tumbling to work great. However, the functions for the middle and right mouse are non-existent for me right now.

I would like to emulate the pedestal and truck motions, which is where the local camera coordinate system moves up/down or left/right within its own coordinate system. I would also like to zoom in/out of the cameras local z axis.

My representations for the camera object's orientation is where I need help. I have eye, up, and center, and I compute a 4x4 matrix for a lookAt() function that works well for tumbling.

How can I move the camera along a single local axis?

Thanks for any help ahead of time.

mikau
03-05-2010, 11:39 PM
I'm pretty sure the best way to do this is to create a camera object that keeps track of direction and orientation, and provides all the functionality for moving, based on its present orientation. Its a fair bit of math, but its doable. Then you just need to call lookAt function, and use the data in your camera object to set your view up properly.