I have a Babylon canvas embedded into an HTML layout with a header and a sidebar overlaying the rendering canvas. I’d like to offset the scene’s main ArcRotateCamera relative to the canvas according to the following schematic:
I tried using the camera’s targetScreenOffset property, which seems to work, but I’m not sure how to get the appropriate values for the correct offset.
targetoffset changes viewMatrix and hence, is a world 2d offset applied in camera local space. I’m not sure that will be easy to set as is depends on the distance from camera to target.
Instead, I would suggest to change the viewport size like this:
Thanks for the suggestion!
Hoewever, extending the viewport above 1.0 messes with scaling and framing. In order to have a positive Y offset of 0.15, I need to vertically extend the viewport by 30%, making the negative effects very noticable.
Sorry for the confusion.
Scaling the viewport up is like “zooming in”, messing with my camera settings (distance, framing-behavior, etc).
This will probably also have some performance implications?