Fixed an 3D object on the scene/screen

Hi, I want a 3D dimension axis fixed on the screen, just like in CSS
.object{
position:absolute
top :10px
left:10px
}
Should I use two canvases ? or there are other solutions? Thanks!

With anything in Babylon.js there’s no one way to do something, but one possible method is to use a second camera and a renderTargetTexture. It takes the view of a camera and maps that to a texture.

So you could add a second camera that always inherits the rotation of user input. That camera would use a layer mask to only render the dimension axis gizmo…then you can use that texture as an overlay on your screen. Lots of different ways to do that, but this doc will hopefully help:

1 Like