Rotating orthographic (arcRotateCamera) 180 degrees (top view)

HI,
How do I rotate a top view orthographic camera 180 degrees?

https://www.babylonjs-playground.com/#SRZRWV#264

eg
var topCamera = new BABYLON.ArcRotateCamera(
“top”,
(0 * Math.PI) / 8,
(0 * Math.PI) / 8,
3,
new BABYLON.Vector3(0, 0, 0),
scene
);
topCamera.upVector = new BABYLON.Vector3(0, 0, 1);

topCamera.upperBetaLimit = 0;
topCamera.lowerAlphaLimit = 0;
topCamera.upperAlphaLimit = 0;
topCamera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;

camera = topCamera;

// How do I rotate the camera so that the red square is below the blue one
// Does nothing?
// camera.rotation.x = Math.Pi/2;

For the ArcRotateCamera, I think you want to be setting the alpha/beta rather than the x/y/z of rotation.

2 Likes

Maybe the beta could rotate it. I’ll try.

topCamera.lowerAlphaLimit = Math.PI;
topCamera.upperAlphaLimit = Math.PI;
topCamera.alpha = Math.PI;

Seems to get what I’m looking for. I didn’t think modifying the alpha would work, but it did. (I don’t know why it works - I thought this would make me look at the world from the bottom). Thanks!

1 Like