• Advertisement

Archived

This topic is now archived and is closed to further replies.

Angle -> Vector

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

How do you convert from an X/Y angle pair into a directional vector that could be accepted by a spot D3DLIGHT?

Share this post


Link to post
Share on other sites
Advertisement
If you''re talking a Theta/Phi pair, you can plug them into the parametric form of a sphere and get a normalized vector in return. Ask if you need more help.

Share this post


Link to post
Share on other sites
Well I know what you're talking about but I don't know how to implement it/what to do. Could you explain?

Edit: Corrected some grammar

[edited by - Karl G on September 1, 2003 6:01:21 PM]

Share this post


Link to post
Share on other sites
x = sin(theta)*cos(phi)
y = sin(theta)*sin(phi)
z = cos(theta)

Where theta is rotation about Z (in the interval -pi to pi) and phi is rotation about X (in the interval 0 to 2pi).

This should result in a unit vector pointing in the desired direction.

Later,
ZE.

Share this post


Link to post
Share on other sites

  • Advertisement