Orient the orthographic camera

Hello,
I want to use 2 viewports, one with an ArcRotateCamera and the other with an orthographic camera. On the playground the main view is that with the ArcRotateCamera .
I’m looking for how to see the view of the green face of the cube with the orthographic camera without changing the original orientation of the cube.
On the other hand, when the main camera moves, the view with the orthographic camera should not move.
https://www.babylonjs-playground.com/#GU4CP2
How should I do it ?
Thank’s

Hi @mecanicus,

Excellent question!

  • Set the Orthographic camera position only in Y position (higher than any object to render), and set Orthographic camera target at (0,0,0) so it looks down from positive Y axis (the green face is on positive Y axis)
  • Remove the control / input handlers for the Orthographic camera (have only first camera handle input controls), see https://doc.babylonjs.com/how_to/customizing_camera_inputs

See the playground I updated for you:

Does this solve your question?

I’m working on a similar thing with a 3D (player) view and a 2D map / 3D level overview view in split-screen. It’s going quite well but found some challenges/bugs when doing more advanced stuff like GUI clicks handling. See my post:

Enjoy!

Q

1 Like

This is what I needed. I still have a lot of difficulty to understand the positioning of the cameras. Thank you so much QuintusHegie