Jump to content
  • Advertisement

Archived

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

Karl G

Angle -> Vector

This topic is 5406 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!