Orient camera according to specific axis positionning

Hi, I want to position my ArcRotateCamera so that the axis look like this:
Axis

But I am really struggling to do it because of the behavior of the Camera.

Is there an easy way to achieve this.

I will implement a button so that the user can click on it and the camera will automatically be pointing in a position related to the axis.

I have quicly create a playground to test it: https://playground.babylonjs.com/#2EYZPE#286.
My initial project is much more complex tho, I use Babylon in an Angular project to view mesh, so take note that in my project, the ArcRotateCamera rotate around the center of the loaded mesh.

Thank you!

Marc-André

Howdy,

One way of achieving this is to add a transform node as a parent for the camera and provide an initial rotation to it in order to “change” the camera’s upvector.

andre | Babylon.js Playground (babylonjs.com)

Woah! it is exactly what I wanted! Thank you for the extremely fast respond! You guys are amazing!

Have a great day!

1 Like