I’m trying to get a text plane Gizmo to work with an orthographic arc camera on a rotated mesh. I seem to lose the correct scaling of the gizmo text plane when zooming. And when I apply the rotation to the parent mesh, the billboard mode of the text Gizmo seems to break.
In this playground: https://playground.babylonjs.com/#P89ASS#18 - I’ve got the ortho camera working, but the scaling of the gizmo text doesn’t work like the first example. I’m trying to get the text size to maintain 12px on the screen no matter how far you zoom. Is there something I’m missing?
There’s also an issue when I apply a rotation to the parent mesh in both playgrounds above:
Line 114: sphere.rotate(BABYLON.Axis.X, Math.PI / 2, BABYLON.Space.LOCAL)
It seems to break the gizmo billboard. Have I implemented the Billboard incorrectly?
Thanks in advance - I appreciate any help/guidance anyone can give
I think you might over engineer your playground in ortho.
First thing is aligning toward the camera, this can be done without gizmo, only with billboard mode. For example like this: Billboard Behaviour | Babylon.js Playground (babylonjs.com)
Then, when zooming in/out. I would simply apply the same delta to the mesh (or a parent transform) scaling. If view bounds is twice bigger, then scale the mesh twice bigger.
Adding a gizmo in ortho will not help because at its core, it compute the gizmo scale based on distance to eye. But in Ortho, view size doesn’t depend on camera distance but view bounds.