Camera view offset


Currently we have been using three.js for creating webgl applications, but we want to move to Babylon.
We were looking into the features we had in three and how we could implement them in Babylon.

For some background info:
We use the automatic vertical tilt in 3DS max to get the vertical lines to go straight up so it looks better. but when importing the camera into three.js this didn’t match up with the actual render made from that camera. so we used setViewOffset to create this effect.
^^link to three.js docs where this is explained.

So we are wondering on how to do this in Babylon, if its possible or maybe if it exports it with it(we are using the .babylon file format)

Here is a small demo to what we want to accomplish, if you click previous(13-13) a render should be overlayed on the canvas with the viewoffset applied, if you click previous again you can see the canvas isn’t the same as the render because the offset isn’t applied

So is there any way to get the same result in Babylon?

Kind regards,

@Guillaume_Pelletier and @Deltakosh do you know if vertical tilt is supported ?

@Evgeni_Popov and @RaananW do you have some great ideas to support it in our lib ?

And by the way @Axel_Musch Welcome to the community !!! :slight_smile:

Vertical tilt is not processed as it, into the exporter. We might do it if we know how to save it into Babylon format.

1 Like

I don’t know what vertical/horizontal tilts are doing in 3DS Max, so can’t help here.

Regarding setViewOffset, I guess it could be added to the camera class, but we would need to make it work for 4 cases (right/left handed + std/reverse z) when Threejs is only right handed + std z I think.

1 Like

Thanks for the responses!

so the conclusion is that it isn’t really possible now but it might be added in the future?

What would be the best way to get notified if/when it gets added?

I think you should create an issue in the repo and link to this thread, so that we can keep track of it. Regarding timing, I don’t know the priority of this and the availability of people, so can’t tell. Feel free to create a PR if you wish :wink:

1 Like