the problem is that this camera system is not object centered.
I wish, when rotate , rotates the object around its axis and for the traslation go ahead and back.
I already done for traslation and mouse weel, but i don't know how do for the rotation of the camera around object.
How i can find the object axis? i have a bounding sphere, and his center.
thanks.
You could use the object's world transformation to find out the axis you'll wish to rotate around.
You should find a function called LookAt to generate a view matrix from desired location to the center of your object. Now, only thing you'll need to do is to rotate the camera location around the axis you get from the world matrix.
Possibly, there might even be a function for that.
You could use the object's world transformation to find out the axis you'll wish to rotate around.
You should find a function called LookAt to generate a view matrix from desired location to the center of your object. Now, only thing you'll need to do is to rotate the camera location around the axis you get from the world matrix.
Possibly, there might even be a function for that.
[quote name='kauna' timestamp='1312205794' post='4843112']
You could use the object's world transformation to find out the axis you'll wish to rotate around.
You should find a function called LookAt to generate a view matrix from desired location to the center of your object. Now, only thing you'll need to do is to rotate the camera location around the axis you get from the world matrix.
Possibly, there might even be a function for that.
Cheers!
thanks, but how i can find the object axis?
[/quote]
Well, you should look in to the world transform matrix of the object, which practically contains 3 vectors describing the XYZ-axises of rotation.
Does it matter that you camera rotates around the object's axis or do you just want your camera to rotate around the object regardless of the object axis?