Pointers for understanding rotations?

Could someone give me some pointers on dealing with the orbitalControls/camera rotation values?

I have a use case where I’m trying to use a Three.js cube to act as a real time reference while I fetch a much slower’s 3d programs image. Much easier to show than explain, there’s a video here and what I’ve got so far is live at repo (though often the first image load is quiet slow due to lambda cold start)

Essentially I’m trying to convert between two rotation systems. Openscad which seems very simple, using the camera only ever changes the X and Z axis, Y is always zero. And three.js seems much more sophisticated and I don’t quiet understand. I think I probably just need to learn 3d math but I’m not sure where to begin.

A very good literature in this context is 3D Math Primer for Graphics and Game Development. The book has a whole chapter about rotation 3D space.

1 Like

Thanks @Mugen87

I’m probably not at the stage where I want to buy any book. I went down a bit of a rabbit-hole with quaternion (at least I feel like I’ve got a bit of a concept of them now), but I ended up just needed to change the order of the Euler rotations.

I’m still having some trouble matching translations between the two, but the rotation is working a treat.
There’s a video of it working here Fix camera perspective and other polish for openscad viewer by Irev-Dev · Pull Request #238 · Irev-Dev/cadhub · GitHub
or the WIP is live here repo