xeokit-sdk
xeokit-sdk copied to clipboard
Euler angles in model rotation does not work as expected
Describe the bug
Changing rotation coordinates does not work as expected, this visualization describes how euler angles work
https://danceswithcode.net/engineeringnotes/rotations_in_3d/demo3D/rotations_in_3d_tool.html
If I try the same thing in xeokit, I get very different results
To Reproduce Steps to reproduce the behavior:
- Go to an example model https://xeokit.github.io/xeokit-sdk/examples/buildings/#xkt_vbo_Duplex
- change the x and y coordinates
const model = viewer.scene.models.myModel
// [pitch, yaw, roll]
model.rotation = [30, 90, 0]
Notice how the x and y rotations are always local to the object's axes
Expected behavior
I expect the rotation to work like this visualization of euler angles (yaw being y axis, x being pitch)
I'm not sure how xeokit calculates rotation, if anyone can provide me with a way to make the object's rotation global instead of local that would be appreciated
Thank you