Sign in to follow this  

rotate around an object

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Treat the rotation point as an axis with the same value as your camera's up vector. Then what you need to do is called 'rotation around an arbitrary axis' (Google-wise). It's quite complex mathematically. Your best bet is Google, there are lots of pages that explain how to do it in different ways, plus source code if you look hard enough.

Don't forget to subtract the rotation point's position from the camera's position before you rotate. Then, when done, just recalculate the camera's view in the normal way.

Share this post


Link to post
Share on other sites
i simplified this case of drawing a circle given a center & a point on the circumference of the circle.

how do i find the next pt. on the circle's circumference given the two pts. (radius & start pt.); next pt. defines the camera position at the next time step.

could someone help me out !!

~ boyd

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.geom.uiuc.edu/docs/reference/CRC-formulas/node45.html#SECTION02210000000000000000

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dear schoolkid,

The following may be what you require. If not, indicate that you do not and restate the question.

The following is for Cartesian Coordinates.

Let the point C(C1, C2) denote the center of the circle.
Let the point O(O1, O2) denote the starting point on the circle.
Let V denote the linear velocity of the points on the circle.
Let T denote the time elapsed in the same units as the time for the velocity. i.e. If V = meters per second, then T = seconds.
Let the point P(P1, P2) denote a point that moves along the circle with center C and that contains O, with a constant linear velocity of V for T seconds.

Then the point P, which you wish to have information on, will be defined by the following.
P = (P1, P2) where
P1 = R*cos(V*T/R + arccos((O1 - C1)/R)) + C1
P2 = R*sin(V*T/R + arccos((O1 - C1)/R)) + C2
and R = SQUAREROOT((O1 - C1)^2 + (O2 - C2)^2).

The point P is then really then a function of the time T, and the coordinates of P are each defined by a function of T. i.e. P(T) = (P1(T), P2(T)).

Please forgive any slight errors of if this was not what you intended as an answer.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this