Rotate a BABYLON.GUI.Rectangle in 3 axis?

I know that this is counter-intuitive but I wanna rotate a BABYLON.GUI.Rectangle in 3 axes, probably you want to ask me about using a regular plane but there are two reasons to avoid it:

  • I need to be always on top over the rest of the scene.
  • I need to have it resolution independent, I mean it should keep the same size independently from the distance to the camera.

So BABYLON.GUI.Rectangle meets all the requirements … but what happens if I want to orientate it?

Obviously if you know another way even using regular planes to do that it could be helpful!

Sample to play with (Babylon playground is addictive!)

1 Like

3D rotation doesn’t seem to be possible. But you can rotate around z-axis.

Documentation: The Babylon GUI | Babylon.js Documentation

Perhaps you could use multi scenes Using Multiple Scenes | Babylon.js Documentation with a plane in the front scene and a fixed camera.


what about to fix a mesh to the camera as parent?

1 Like