Advertisement

Finding angles of an object

Started by July 04, 2002 04:37 PM
3 comments, last by Script 22 years, 7 months ago
Ok, here''s the problem: I have an object defined, and it has certain amounts of rotation on the x, y, or z axis. Basically, how do I find the Forward, right, and up vectors of this object?
~Script
hmm...

You arnt very...explanatory...
See...
A point P can have any kind of rotation as the planes of rotation change...

So you have a object O, with center P, on a Euclidian 3-space.
So you have 3 primary planes, the X Y and Z planes.

You denote P by a location on each plane...(x,y,z)

That means so much in X, so much in Y, etc.

If you desire to rotate this object, there are alot of tutorials on it out there.

If you can`t find any, ask for some links here.

~V''lion
~V'lionBugle4d
Advertisement
Hmm, I can already rotate the object. Maybe this will help explain what I''m trying to ask:

Let''s say we have an object at 0,0,0. It''s forward vector is the direction it''s facing. It''s up vector is straight up from the object, and it''s right vector is directly to it''s right. All the vectors are perpendicular. So let''s say it''s forward vector is 0,1,0, it''s up is 0,0,1, and it''s right is -1,0,0. Let me try to make a picture, looking down on the object:

Forward vector(1,1,0)
^
|
|
O---> Right vector(-1,0,0)
/
/
|/ Up vector(that''s an arrow at the end, bad ascii art)
(0,0,1)


So when I rotate the object on any plane, I need to be able to find those vectors again, given it''s new orientation. Am I just going about this the wrong way? Thanks for your time.
~Script
The X,Y,Z axes can be read straight off the 1st,2nd and 3rd column (or row, depending on you graphics API) of the transformation matrix.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Well, thanks for the try (still not sure if you quite understand what I was trying to do), I finally figured out a solution on my own. I guess I''ll try for 2 weeks next time before I ask for help.
~Script

This topic is closed to new replies.

Advertisement