Display Axes


It is often useful to be able to quickly display world and local axes to see position and rotation for example. For world axes use

const axes = new BABYLON.Debug.AxesViewer(scene, length_of_axes)

To make any of the x, y and z axes local to a mesh (or other appropriate object) use

axes.xAxis.parent = mesh;
axes.yAxis.parent = mesh;
axes.zAxis.parent = mesh;

You can customise the axes, which do not have to be orthogonal, using

axes.update(position, xAxis, yAxis, zAxis) //all parameters are Vector3s
Update AxesViewer

Further reading