Notifications
Clear all

[Closed] eulertoquat doesn't work properly

Hello, I have problem which eulertoquat function.
In simple example(one axis rotation) function work properly.When I use more axis to rotate everything works wrong.

"AS_Cone"[0,-90,0]
"AS_Cube"
[-45,0,0]
"AS_Cube.001"
[-88.286,4.69777,-14.9297]
"AS_Icosphere"
[-90,1,80.4436]

It is data from blender
I use

obj.rotation=eulertoquat (eulerAngles -(rotO.x) -rotO.y -rotO.z )

The result
AS_Cone [0,-89.9,0] <- OK
AS_Cube [-45,0,0] <- OK
AS_Cube.001[-88,233, -14,783, -5,151] <-SWITCHED AXIS BIG MISTAKE
AS_Icosphere [-90, 80,444 ,-1] <-SWITCHED AXIS

If I do

obj.rotation=eulertoquat (eulerAngles -(rotO.x) -rotO.z -rotO.y  )

AS_Cone is wrong.What Should I do now?
Thanks for any reply.
//EDIT
I always must go around

obj.rotation.x_rotation=(rotO.x)
obj.rotation.y_rotation=(rotO.y)
obj.rotation.z_rotation=(rotO.z)