PG: https://www.babylonjs-playground.com/#AYD85K#39
Why does the car flatten when the rotation vector changes? I noticed that this only happens with gltf models.
How can I gently rotate the car 90 degrees?
PG: https://www.babylonjs-playground.com/#AYD85K#39
Why does the car flatten when the rotation vector changes? I noticed that this only happens with gltf models.
How can I gently rotate the car 90 degrees?
newMeshes[0] is the root mesh, you just need to rotate that https://www.babylonjs-playground.com/#AYD85K#40.
Rotating individual children, as you have seen, is not the same as they will rotate around their local origins.
Opps sorry will have another look.
It is because the gltf models have rotationQuaternion applied and setting a rotation can cause problems. Whereas from BJS 4.0 see warning this problem was overcome when applying a rotation as a new Vector3 directly https://www.babylonjs-playground.com/#AYD85K#42
Using the set method to alter Vector3 values does not trigger the nulling of the rotationQuaternion this has to be done separately as in https://www.babylonjs-playground.com/#AYD85K#41