How can i show a small world axis on the screen like this、

previewAxis

thanks!

1 Like

You can use AxesViewer:

https://playground.babylonjs.com/#S11K41

1 Like

@Evgeni_Popov
but i can’t find any method to render to screen like a picture

What do you mean? You also want the X/Y/Z texts?

This snippet should do it:

emm,in fact,i used rtt implement that before by three.js,but i don’t know how to do with babylon;
and rtt is complex.
i need a img to guide the user to the world coordinates

in fact ,i wonder if there are more easy way to implement that without CustomRenderTarget

I think you should create a PG, I don’t really understand what you want to achieve…

If you want the axis to stay fixed on screen, this could help: How to get Fixed AxesViewer in Left Bottom - #5 by dineshax100

yean,that’s how it feels,let me try it,thanks

https://playground.babylonjs.com/#QXHNNN#5

I want to know why these three vectors

maybe it just like a clip plane??? Or maybe these are related to the camera parameters

https://playground.babylonjs.com/#QXHNNN#8

I got what I wanted by adjusting the parameters,However, in my project, the parameters need to be adjusted further

Yes, those vectors are just offsets from the camera position where to put the axis. So it will depends on your scene / settings.

1 Like

https://playground.babylonjs.com/#QXHNNN#10

Line 19,if i use the rightHandedSystem,i have no idea to adjust the new position according to the camera’s position
i tried some times,but I didn’t get the right result,maybe you can help me @Evgeni_Popov ,thanks

1 Like

You have to negate the z value in p.addInPlace(camera.getDirection(new BABYLON.Vector3(0, 0, 15)));:

https://playground.babylonjs.com/#QXHNNN#11

1 Like

thank you very much!!!

Thanks for your solution! I have another question. How to fix the axes indicator at the corner of canvas or screen, especially the window is resized. I find that the offset of playgroud #11 is hardwired, and I don’t know how to adjust with canvas/scene

You can try to use an additional camera that does not move and so that will show the object always at the same location.

Maybe this thread can help too: