Easy way to rotate primitives

Hello,
I have another beginners question.
Can you tell me how to change the rotation point for primitives?
I have some primitive (flat ellipsoid) and I want to rotate it over some local coordinate. I change the value of rotation matrix etc, but all changes are around the Earth center (global coordinate).

My idea was sth link move primitive on specific axis (like point lat = 0, lng = 0) rotate and than move to my coordinates but it makes no sense because it uses rotation matrix and translation matrix which are "independent" (I mean values are independent, all of that data are in Matrix4).

I want to simulate sth like aircraft (now I have flatten ellipsoid), and show pitch, roll and heading.

Is some easy way to do this using some functions? Or the only way is calculate translation and rotation every time for specific point?

Bests!
Artur

Artur,

If you are using an ellipse - as opposed the ellipsoid - Shapes.computeEllipseBoundary takes a bearing angle that is used for rotation.

As for general rotation with the EllipsoidPrimitive, construct a 4x4 matrix as you suggest using the helper functions on Matrix4. You’ll multiply three matrices like [translate][rotation][translate].

Patrick