The easiest way to create a fixed axes without ORTHOGRAPHIC_CAMERA?

Hello,
I am new to babylon.js.

First, I am trying to create a fixed size coordinate system in the bottom right of a scene, refer to this topic,
How to get X,Y and Z labels attached to axes? - Questions - Babylon.js (babylonjs.com)
However, I found that the model cannot transform bigger or smaller, due to the camera mode is ORTHOGRAPHIC_CAMERA I guess?
So, I tried to change the camera mode, this is my pg: glTF Loader Demo | Babylon.js Playground (babylonjs.com)
but I found that the axis was a little transformed and were not perpendicular to each other?
Is there any way to solve this problem, by making a fixed not transformed axes and can also change the size of the model?
Do I need to draw the axes using CreateLines?

Welcome aboard!

You could try to use an additional orthographic camera that would only render the axis viewer:

It gets the quaternion from the scene camera and uses it to correctly transform the axis of the axis viewer.

1 Like

Tks a lot, solved my problem. Still need some time to figure out how this works though :rofl:

Note that the multiplication by quatX / quatY for the x/y axes is due to the fact that there is a default rotation for these two axes in the AxisViewer class, and that we must therefore take them into account.

Sorry to bother, I am trying to add a pick mesh function based on this pg glTF Loader Demo | Babylon.js Playground (babylonjs.com)
Line 19, I added:
scene.onPointerDown = function (evt, pickResult) { console.log('pickResult', pickResult) };
But it does not work, I am guessing that the axisCamera blocked the mesh?
Is there any solutions? :rofl:

You need to set scene.cameraToUseForPointers with the first camera, else the system is using the last camera of scene.activeCameras by default for pointer events:

Amazing! Thanks again :smile: