Angle Issue

Blitz3D Forums/Blitz3D Programming/Angle Issue

Nack(Posted 2008) [#1]
I am currently trying to write a wrapper for something (remain nameless to save from embrassment if i were to fail =]). However, the angle that I receive from it is quite different.

Now i am no angle expert, I dunno what these are called (euler? quat? wth? haha)

in Blitz3D I realize this:
let say cube angle Yaw, it goes from 0 - 180, then -180 to 0

in the dll that i got:
It returned in radians, so I take the radians and times it by this:
radians * 360/pi
It then goes from 0 to 180...then 180 back to 0.

Now as one can see the two system angle is quite differnet. I was wondering is there anything I can change taht could make these two system compatiable? Maybe my formula is wrong?

Nack


Jasu(Posted 2008) [#2]
I'm not quite sure what you want, but if you want to convert radians to -180 - +180 , you have to do a bit more code. First of all, does the dll return radians only in range 0 - 2*pi or can it be anything? If it's only in the range then this will do:
angle# = radians * 180/pi
If angle > 180 then angle = angle - 360



FlagDKT(Posted 2008) [#3]
degrees=radians*180/pi

edit:ops jasu already answered :)


Floyd(Posted 2008) [#4]
It probably won't be this easy.

Pitch, Yaw and Roll don't have any meaning in isolation. They refer to three rotations done in some particular order. You have to know the details of the system being used. And to add to the confusion the coordinates may be left handed or right handed.

Blitz3D uses the rotation order Y-X-Z. And, like Direct3D, the coordinates are left handed. You need to find out the corresponding details for the "nameless something" system.