- Home /
How to rotate camera viewport?
Hello. I'm trying to create an application with holographic pyramid and I need to manipulate a camera viewport.
Right now, I have a scene with four cameras positioned around some cubes in order to get the view for each side of the environment. I already set the viewport rect for each camera.
Scene View:
Game view:
What I need now is to rotate the viewport for each of the cameras. The result must be something like this: https://www.youtube.com/watch?v=dnhMAQpeZ3s
Each of the viewport must be rotated in a way so the bottom of each camera's view should be facing towards the center.
I've heard I just use Matrix4x4 and Camera Projection for this, but I couldn't manage to make it work properly. I will appreciate any help provided.
Answer by mikelortega · Sep 21, 2015 at 10:16 AM
I would create a new GameObject (for example "FourCameraSystem") in the center, and make the four cameras this object's children. Then you only have to rotate the parent and keep the cameras' relative position fixed.
FourCameraSystem <---- rotate this
Camera0
Camera1
Camera2
Camera3