Return Axis rotation between 0 and 360


#1

Hi

So I’ve been trying to solve how I can return the axis rotation of an object as a value output between 0 to 360.

Right now I’ve got as far as this:

rotation = (object.transform.rot.toAxisAngle(new Vec4(0,0,1)));
degrees = Math.toDegrees(rotation);

This outputs the correct angle, however it seems to not wrap back around to 0 when it gets to 360, instead it starts counting backwards from 360 to 0, so it takes two full rotations to turn to 0 again.

I’ve tried various solutions from what I can find, however I’m clearly missing a key component here. Also my understanding of Euler rotations is limited so any help would be great!


#2

Armory’s rotations are basically f*cked, your are encountering a known bug/oversight.


#3

Ah that’s too bad, I’ll have to wait I guess


#4

Maybe can help you that you can have good results using armature/bones on your object and quaternions to rotate.