Rotation Quaternion

Hi all,
I am working in a live project, It has more lines of code. For a rotation animation. I need to set the rotationQuaternion of that particular model as null. If I not make that as null, the rotation animation is not working without any error message. but position animation is still working. If I set the rotationQuaternion as null, then I need to set an initial rotation value to make the model correct. I am doing something wrong, which is making the model requires the rotationQuaternion = null. I dont know where I miss that. If anybody already faced like this, Kindly help me.

Hello! You can’t use both quaternion and euler rotations at once. If the model has quaternion rotation set, mesh.rotation will not work. Search on the forums, there are topics about this behavior and the documentation is mentioning this as well.

Rotation Quaternions | Babylon.js Documentation

Search for the WARNING section.

R. :vulcan_salute:

2 Likes

Thanks For your reply @roland, but I don’t want Quaternion, I need only the normal rotations. I didn’t set the quaternion value. Then Why it requires the rotationQuaternion = null

Because your model has set the rotations using quaternions. Drop your model into the sandbox and check for this and you’ll see:

2 Likes

Hello @jayakannan just checking in, was your question answered?

1 Like

Not yet. Still confused. It would be nice to have a PG on both using Rotation Quaternion and Euler Rotation.

Something like these

Rotation Conventions | Babylon.js Documentation ?

I posted the same before with the link as well…

1 Like

Sorry @roland . It has been still confused to me. Because, in a project, without making the rotation quaternion to null, the animation is working, but in another project, it is working. Since, this is a commercial project, I couldn’t share that. I have to compare both of them. But, it should be wrong, if I allow this post as open for my mistake. That’s why I just mark that as solution.

1 Like

No worries!

I think you wanted to write the it’s not working in one of them. Are these projects both BabylonJS? Are the input files the same? If that’s the case and the BabylonJS version is the same it doesn’t make sense and there must be something in your code.

But remember, that some models can come with Euler rotations and in that case you don’t have to set the quaternion to null. For example you can set the rotation using Euler angles in Blender as well.

2 Likes