rotate around an object

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

Recommended Posts

hello all, how do i rotate my camera around an object in reference, i would like to know the math steps that I need to do plz help me out !! ~ boyd

Share on other sites
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 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 on other sites
http://www.geom.uiuc.edu/docs/reference/CRC-formulas/node45.html#SECTION02210000000000000000

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

• 17
• 10
• 21
• 16
• 9