I am trying to make a gimbaled magnetic compass work, and realize yet again that I do not understand 3D operations as documented. The gimbal stuff is not shown – I am trying this on the compass dial to keep it pointed north and up in world space no matter how the compass rotates:

Vector3f f = mSpatial.worldToLocal(NEGATIVE_UNIT_Z, null);

mSpatial.getLocalRotation().lookAt(f, mSpatial.worldToLocal(UNIT_Y, null));

the result is a wildly rotating dial, like a tossed nickel spinning before falling flat on a table.

How does one set a rotation in a coordinate space OTHER than that of the Spatial’s parent node?


Theres spatial.localToWorld() and worldToLocal()… Also theres this: