Once again I’m trying to reproduce some behavior in Urho3D that I have in my SceneKit implementation.
I have various objects labelled onscreen and say I want to have a label centered on a point but use FaceCameraMode.RotateXyz.
I can center the label on a position (0, 0, 100000) by doing something like.
var size = text3D.BoundingBox.Size * fontScale;
textNode.Position = new Vector3(size.X / 2.0f, size.Y / 2.0f, 100000.0f);
This works fine when not using FaceCameraMode. However, I need the labels to always face the camera. In this case the label is centered properly when looking down the z axis, but not as you pan around looking a the scene from other directions.
In SceneKit there is a concept of “pivot”. Rather than offsetting the position, you would offset the pivot and then the label would remain centered on the point at all angles.
https://developer.apple.com/documentation/scenekit/scnnode/1408044-pivot
I’ve also read that setting the pivot is conceptually the same as introducing an intermediated node and translating the intermediate node rather than adjusting the position of the text node.
I’ve tried the intermediate node solution, but it doesn’t seem to work with FaceCameraMode on.
Is there a simple (or even not so simple) solution to this problem?
Thanks again.