I need to display two viewports, each for a different camera (two cameras).
Can this be done? How?
I need to display two viewports, each for a different camera (two cameras).
Can this be done? How?
There is a viewport
property on camera, simply try playing with it.
Iβve created an example project that displays multiple viewports using multiple cameras here: https://playcanvas.com/project/443666/overview
Itβs due to be added to the tutorial section.
Steven,
I am trying to understand how you got it to have multiple viewports on the same screen. There seems to be no code or documentation. Could you please explain how you are doing this?
Is it possible to set this with code on the fly?
If you want to change it on the fly, pc.CameraComponent.rect
is the property you need to look at: https://developer.playcanvas.com/en/api/pc.CameraComponent.html#rect
In the editor, the property viewport is the property to change: