ArcRotateCamera shift Y

Hello,

Is there a way to emulate the Shift X & Y like we have in Blender on an ArcRotateCamera please?

GIF attached to illustrate what I mean.

Thank you.

Is It Like panning ? if it is you can do with right click or by pressing the control key ?

Hi @sebavan, no it’s not like panning. In BabylonJS terms, it would shift the canvas… something like:

scene.activeCamera.viewport.x = 0.5

…however, if I do the above you only then see half the canvas.

Does this make any sense?

Thank you.

How is it different from panning ? Is it not the same effect. Sorry for my lack of understanding.

Panning moves the position of the camera. Blender’s ‘shift’ keeps the camera in the same position but moves the view. I fear this doesn’t make much more sense as I can’t find the words to explain!

Some other Blender users on here will hopefully know what I am talking about.

Thank you for your help though, @sebavan.

Ok I understand better now :slight_smile:

We do not have anything like this available. I am wondering about the use case against for instance attaching the camera to a parent node.

Attached is a quick sketch illustrating why this can be useful. It enables a perspective image to have vertical lines. This would only work if you are rotating about the Y axis, though.img005

I see and I am not sure it should be part of the default camera let see what @Deltakosh thinks.

You could nevertheless define your own camera and replace the projection matrix to fit your needs.

Is that somehow different from a camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA ?

Yes, in that its a perspective camera.

Attached are three renders:

  • Perspective camera shift
    camshift-01
  • Perspective
    camshift-02
  • Orthographic
    camshift-03

I am using Babyon to render out single images rather than interactive stuff so it may be than very few people would ever make use of it.

So if you want to stay in perspective mode you can probably play with camera.fov to see if that fits your needs?

@babbleon I think what you want can be achieved with targetScreenOffset: ArcRotateCamera - Babylon.js Documentation maybe in combination with camera.lockedTarget. I think I did something like this with these two properties. Let me know if you need help!