#### Archived

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

# rotating a point around another point?

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

## Recommended Posts

is there a way to rotate a point around another point with directX? i don''t need it for rendering, but i need to do it somehow. i know the math for it, just kind of dreading it. it would be realy nice if dx had some kind of function just to give it the vector to rotate, the vector to rotate around, and the angles. would simplify code a ton.

##### Share on other sites
well if you making anything 3D you should have your own Matrix Code... and a rotation matrix... once you get them its really easy to do rotations...

here is equation for rotation of A around point B by rotation matrix RotMat;

so to rotate Vector A around Vector B by a Rotation Matrix;

A-=B;
A=RotMat*A;
A+=B;

The rotation matrix I use allready have the values set but dont are not multiplied by a vector... which means you can rotate many vectors using the same rotation...

[edited by - crakinshot on July 27, 2002 5:32:54 PM]

##### Share on other sites
and i have to make my own matrix for that right? like not dx''s ones?

##### Share on other sites
Why don''t you just you Sine and Cosine? It''s pretty simply:
vector2 += vector1;

##### Share on other sites
Why don''t you just you Sine and Cosine? It''s pretty simply:
vector2 += vector1;

When they come for me I''''ll be sittin'''' in my desk with a gun in my hand wearing a bullit-proof vest singing "My, my, my, how the time does fly when you knw your gonna die by the end of the night!"

1. 1
2. 2
Rutin
21
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013603
×