So, I’m kinda new to Unreal, and I’m trying to make an astronomy project where I have the sky, constelations, a sun, moon, etc., that must revolve correctly around the Earth’s center.
In my astronomy library, I can get horizontal coordinates for objects in Elevation/Azimuth angles, so I can set the Pitch (elevation) and Yaw (azimuth) accordingly for my rotator.
Problem is, in this context, (i’m using Set Relative Rotation), I stumbled on a gimbal lock when the Azimuth’s angle (Z) comes very close to the Roll (X), making all my objects in sky suddenly make an abrupt turn around, and all of it seems weird, especially for the moon and other planets (the sun isn’t a problem, since no one notices the rotation of a pure light sphere).
I searched everywhere for a solution, and the most I could come close is “use quaternions”. It happens no body told me how to use them, and especially in Unreal to make this work and I have no clue where to start. I don’t understand them very much also, but it for what I’ve read, internally when I call Make Rotator Unreal is already making a quaternion representation of this rotator. So why I still get this gimbal lock?
Any help appreciated.
Thanks.