Radians to rotate_sprite
Ceagon Xylas

I'm so not in a programming state of mind, but I still want to get this done. How do I convert radians to respond correctly to allegro's rotate_sprite()?

I know that

Degrees     Radians     Fixed(?)
360°     =   PI*2    =    256
180°     =    PI     =    128
90°      =   PI/2    =    64

I'm not using degrees at all, so ignore that. I'm just showing I understand what is going on, I just dont know how to convert radians to fixed (if that's what you call it.)

miran
float allegro_degrees = radians*128.0/M_PI;
// or
fixed allegro_degrees = ftofix(radians*128.0/M_PI);

Ceagon Xylas

Woo! Thanks a ton!
[edit]
Hehe yeah, I figured that after the first example didn't work =]

Thread #573918. Printed from Allegro.cc