[Papervision3D] Degrees comparison

BeppeT spa_m at giuseppetilli.com
Sun Dec 16 17:10:07 PST 2007


Hi, a silly problem:
today I encourred in a particular issue:
I made it rotate using a loop in EnterFrame:
container.rotationY+=1;

I wanted to change the content every time my container made a turn

if (container.rotationY==90)

and... it din't change

So I traced the container.rotationY and that's what I got:

*1
*2
*3.0000000000000004
*4
*5
*6.000000000000001
*7.000000000000001
*8
*9

I think it is due to the fact that degrees are stored as radians and
reconverted to degrees.

since I need to add int values to the rotation the solution it's quite easy:
if (Math.round(container.rotationY)==90)

but how can I do if I wanted to use something like 
if (container.rotationY==var*(90/otherVar)) // my experiment next step
should be that way
?
should I really use human-less friendly radians?

-- 
View this message in context: http://www.nabble.com/Degrees-comparison-tp14368562p14368562.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list