Skip to main content
gamedev.net
🔒 Locked

pie question

Started by adam23 2 replies 300+ views
Original Post
adam23
adam23
I'm working on a few steering behavior algorithms, and I have been trying to stick tight to the DirectX functions. I am pretty sure I've seen it before, but I can't find it in the SDK. I am looking for a function that converts rotation values in the range of (-pie, pie). Thanks in advance for the help.
Adamhttp://www.allgamedevelopment.com
sirob
sirob
I gather you're looking for a way to convert Degrees to Radians and vice versa? If so, these are D3DXToRadian and D3DXToDegree.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
adam23
adam23
Thanks for the help :)

I need is a function that takes a rotation in radians and converts it in the range of (-pie, pie). Maybe I was wrong, and DirectX doesn't have a function for this, in that case I will write my own. Negative radians will be a counterclockwise rotation, while positive radians will be a clockwise rotation.
Adamhttp://www.allgamedevelopment.com
Evil Steve
Evil Steve
Well, 360 degrees = 2pi radians, so you can just subtract pi from the value in radians to get it into the range -pi to pi.

Topic Locked

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

Sign in to reply to this topic.