Archived

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

Imois

How do I implement an arc rotate tool?

Recommended Posts

I like the arc rotate tool in 3DSMax and I was wondering how it works. Can somebody help me with this?

Share this post


Link to post
Share on other sites
Its really kind of simple when you think about it.

First of, what does it do...

When you move the mouse left and right, it rotates the camera around a circle while looking at its own center.

So, First detect the mouse movement in the same way that you would use to rotate a mesh. (you can find tutorials on this.) But instead of changing theta for the mesh, store it to a variable. Using simple trig, you can find out where the camera should be at any particular degree. Move the camera to that location, and set the camera''s lookat to the origin, or the selected object etc.

The problem with the above is that you have to use the camera''s local coordinates, rather than world coordinates.

Hope that helps.

-AcidBurn

Share this post


Link to post
Share on other sites
quote:
Original post by AcidBurn
Its really kind of simple when you think about it.

First of, what does it do...

When you move the mouse left and right, it rotates the camera around a circle while looking at its own center.

So, First detect the mouse movement in the same way that you would use to rotate a mesh. (you can find tutorials on this.) But instead of changing theta for the mesh, store it to a variable. Using simple trig, you can find out where the camera should be at any particular degree. Move the camera to that location, and set the camera''s lookat to the origin, or the selected object etc.

The problem with the above is that you have to use the camera''s local coordinates, rather than world coordinates.

Hope that helps.

-AcidBurn




Thanks for your reply, but I still have a few questions. Like how do you calculate the radius of the circle, and it''s centerpoint?

Share this post


Link to post
Share on other sites