3D Rotation FIXED!!! 回転解決!

Published 2024-06-11
FIXED!!! 解決した!!
The solution: I wanted the order of rotations to be Y,X,Z (first rotate object about its Y axis, then its X axis, then its Z axis)
However when you put it in the code, you have to calculate the rotations in the reverse order, so ZXY, and that solved it.




手伝ってください
Left/Right to rotate the object along its y axis (RotY)
Up/Down to rotate the object along its x axis (RotX)
A/D to rotate the object along its z axis (RotZ)

You can see it looks weird at certain angles.
Press 1 to see it at RotY=45, RotX=90. Right now it is crooked and it is supposed to be straight up.

Most 3D projects seem to only allow you to rotate objects along the XYZ axis of the screen, but I want to make it more natural:
I want to make it so we can change an object's RotX and RotZ relative to the object's RotY.
I need to fix the formula inside. If someone could fix it, thank you very much

@MathMathMath and SplatHero7 for original projects