Jump to content
• Advertisement

# Move and Rotate a point around a new origin

This topic is 2894 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

I'm trying to do something like this:
http://img28.imagesh.../i/vectorq.jpg/

The pyramid is linked to the box. I have the positions and rotations of both the green box and the green pyramid. The axis intersecting the green box is at (0, 0, 0) with a rotation of (0, 0, 0). I want to move and rotate this group to the new axis centered in the purple box. I have the position and rotation of the purple box. What I need to know is how to calculate the new rotation and position of the red pyramid.

It's been quite a while since I've done stuff like this, so if someone could help me with formulas and how to use them to calculate the new rotation and position, I would appreciate it.

Here's an example if it would help:
Green box position: (0, 0, 0)
Green box rotation: (0, 0, 0)
Green pyramid position: (-24.81, 43.0345, 4)
Green pyramid rotation: (0, -0.22, 0.64)

Purple box position: (49.4771, 90.9461, 61.0026)
Purple box rotation: (-0.12217, -0.2967, 0.38397)
Red pyramid position: (?, ?, ?)
Red pyramid rotation: (?, ?, ?)

If I use the mission editor, I can get the location and rotation of the red pyramid, and it is:
Red pyramid position: (10.6201, 120.922, 52.3397)
Red pyramid rotation: (-0.274722, -0.386207, 1.01696)

Unfortunately, there is no way to access the function the mission editor uses to rotate the group, so I need math formulas so I can manually do it.

Thanks,
LigerZero

#### Share this post

##### Share on other sites
Advertisement

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
21
3. 3
4. 4
A4L
15
5. 5
khawk
14
• Advertisement

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

• Total Topics
633737
• Total Posts
3013607
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!