direction from angles

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

Recommended Posts

The should be a simple one. I've got a: a unit vector pointing -1 down Y and b: three xyz rotation angles. I want to rotate my initialized vector by the three angles, resulting in a new direction.

Share on other sites
Quote:
 Original post by travis08The should be a simple one.I've got a: a unit vector pointing -1 down Yand b: three xyz rotation angles.I want to rotate my initialized vector by the three angles, resulting in a new direction.
1. Build a rotation matrix from the Euler angles

2. Apply the rotation matrix to the vector (0, -1, 0)

Note that if the input vector is a cardinal basis vector (which it is in your case), you can simply extract the desired direction vector directly from the matrix.

Post back if you need more details.

Share on other sites
Just so I'm clear: I am building a rot matrix from the angles, after which I am simply multiplying/transforming my initialized vector by the matrix?

I'm testing this and am getting something close to what I want, but not quite. Want to make sure I'm understanding correctly.

Share on other sites
Quote:
 Just so I'm clear: I am building a rot matrix from the angles, after which I am simply multiplying/transforming my initialized vector by the matrix?
That's correct.
Quote:
 I'm testing this and am getting something close to what I want, but not quite. Want to make sure I'm understanding correctly.
Can you describe the problems you're seeing? In what way are the results incorrect?

There are a number of places that errors could be introduced (for example, missing or misplaced degree/radian conversions, using the wrong vector notation, discrepancies in Euler-angle order, etc.). If you really get stuck, you might post some code.

Share on other sites
Good point about the possible degree/radian issue. That sounds like what might be happening. I will play with this more tonight and post feedback, thanks.

Share on other sites
After a degree to radian conversion all is well. Thanks very much jyk, I really appreciate the help.

Quote:
Original post by jyk
Quote:
 Just so I'm clear: I am building a rot matrix from the angles, after which I am simply multiplying/transforming my initialized vector by the matrix?
That's correct.
Quote:
 I'm testing this and am getting something close to what I want, but not quite. Want to make sure I'm understanding correctly.
Can you describe the problems you're seeing? In what way are the results incorrect?

There are a number of places that errors could be introduced (for example, missing or misplaced degree/radian conversions, using the wrong vector notation, discrepancies in Euler-angle order, etc.). If you really get stuck, you might post some code.

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• Forum Statistics

• Total Topics
633271
• Total Posts
3011161
• Who's Online (See full list)

There are no registered users currently online

×