Rotating a vector about a new origin

Click For Summary
SUMMARY

This discussion focuses on the mathematical process required to rotate a point in 3D space around a new origin and orientation. The user seeks to understand how to calculate the new position and rotation of a point, specifically a pyramid linked to a box, after moving the origin. Key methods discussed include using translation and rotation separately, determining relative positions, and applying three sequential rotations to align axes. The conversation highlights the importance of avoiding singularities by utilizing quaternions or direction cosine matrices instead of Euler angles.

PREREQUISITES
  • Understanding of 3D coordinate systems
  • Familiarity with rotation matrices and transformations
  • Knowledge of quaternions and their application in 3D graphics
  • Basic concepts of Euler angles and their limitations
NEXT STEPS
  • Study quaternion mathematics for 3D rotations
  • Learn about direction cosine matrices and their applications
  • Research methods for calculating transformations in 3D space
  • Explore the implications of singularities in Euler angles
USEFUL FOR

This discussion is beneficial for 3D graphics programmers, game developers, and anyone involved in computational geometry or robotics who needs to manipulate and rotate objects in three-dimensional space.

LigerZero
Messages
4
Reaction score
0
I have a point in 3d space at (x, y, z) with a rotation of (i, j, k) based from the origin (0, 0, 0) with a rotation of (0, 0, 0). What I would like to do is move the origin to a new position and rotation and have the point rotated with it. What series of calculations and manipulations need to be performed to get the point's new position and rotation values?
 
Physics news on Phys.org
Welcome to PF!

Hi LigerZero! Welcome to PF! :smile:

A combination of two equal but opposite rotations about parallel axes is equal to a translation …

does that help?
 
Not particularly. It's been quite awhile since I've done this sort of thing, so you'll need to be more specific on how to get each of those and use them to reach to final two values.
 
LigerZero said:
I have a point in 3d space at (x, y, z) with a rotation of (i, j, k) based from the origin (0, 0, 0) with a rotation of (0, 0, 0). What I would like to do is move the origin to a new position and rotation and have the point rotated with it. What series of calculations and manipulations need to be performed to get the point's new position and rotation values?

I'm not quite sure what you're trying to say, but, generally, translation and rotation are handled separately. The translation accounts for the difference in origins and the rotation accounts for the difference in the direction of the axes.
 
I'm trying to do something like this:
http://img28.imageshack.us/img28/8945/vectorq.th.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 that position and rotation. What I need to know is how to calculate the new rotation and position of the red pyramid.
 
Last edited by a moderator:
LigerZero said:
I'm trying to do something like this:
http://img28.imageshack.us/img28/8945/vectorq.th.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 that position and rotation. What I need to know is how to calculate the new rotation and position of the red pyramid.

Determine the position of the green pyramid relative to the green origin. Rotate so the green axes are parallel to the blue axes (rotation). This gives you the location of the green pyramid relative to the green origin, but in the blue coordinate system. Add in the difference between the blue origin and the green origin (translation).

You need 3 rotations. The straight forward method is to rotate around the green x until the green y lies in the blue x-y plane. Then rotate around the green y until the green and blue z's are parellel. Then rotate around the z until the x's and y's are parallel. The angles have to be something you can determine (roll, pitch, yaw, for example).

If those 3 angles are hard to define, you can take advantage of the fact that a ZXZ rotation duplicates the XYZ rotation (right ascension of ascending node, inclination, argument of perigee, for example).

Watch out for singularities if you use Euler angles (the rotations described in the previous paragraphs). Most programmers use quaternions or direction cosine matrices for the graphics in video games, since those two methods don't have singularities (even though they're harder methods to learn).
 
Last edited by a moderator:
Assuming it's possible to use either of those methods (this game doesn't provide those systems, but looking around, it should be possible to implement them), what would I need to do, step-by-step, to get the new rotation and position?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K