Skip to main content
gamedev.net
🔒 Locked

Rotation

Started by kelaklub Mar 31, 2004 at 2:51 PM 6 replies 350+ views
Original Post
kelaklub
kelaklub
If I have a point in world space and then specify a rotation about that point. Is there a way for me to get a vector from the point in the drection of the rotation? Thanks.
Mister Pink
Mister Pink
all you have to do is multiply your 3 base vectors (1,0,0), (0,1,0) and (0,0,1) by your rotation matrix (or quaternion, depending on what you used) and there you have it. Transformed vector (1,0,0) will materialize your X axis, etc...

The vectors'' length are still 1, since all rotations are isometric (don''t change vector length).

OTOH, not trying to be mean, but if you can''t figure it out by yourself, you''re probably going to have a hard time doing 3D programming. I mean no malice by saying this ! Read some stuff about spacial geometry and transformations, it''ll always come in handy.

Or maybe I just simply misunderstood the whole question, in which case forgive me.
kelaklub
kelaklub
I am picking a point say (0, 0) and then I specify a rotation say 90 degrees. This case is simple because I can say that (0, 1) is another point at 90 degree rotation from (0, 0), and easily get a vector from the two points. How can I do this for any arbitrary point? Thanks.
kelaklub
kelaklub
Wait I think I got it. If I get the vector from the origin to the point I pick and then rotate that vector by whatever angle I have specified, I will have a vector going from the picked point in the direction of the rotation, am I right?
clum
clum
I think you may have to add/subtract 90 degrees or something.

Zorx (a Puzzle Bobble clone)
Discontinuity (an animation system for POV-Ray)
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.