Search Unity

True camera perspective

Discussion in 'Cinemachine' started by A_World_Maker, Feb 23, 2019.

  1. A_World_Maker

    A_World_Maker

    Joined:
    Apr 21, 2018
    Posts:
    214
    Hi,

    Say I wanted to create a security camera feature that I could display several cameras, whist I do not have a problem actually doing that, what I am struggling with is the cameras perspective. Everything is backwards from a side to side aspect, up and down is no problem, so why are the scenes all shown flipped horizontally?

    Unity Camera Mirror Perspective.png

    You can see a display with a render texture on it, linked to its camera shown in the center looking out from the screen. The simple objects in the scene, are flipped in comparison. If my character walks from left to right in front of the camera, the screen shows it walking in the opposite direction.

    This cannot be normal and assumes that all cameras are looking at the same perspective as the players view. I have checked as much as I can (I'm no scripter or programmer) to see if this can be flipped, but cannot see any api's available to do this. I fully understand why the default camera setting must be this perspective, similarly, not all cameras and perspectives are equal.
     
  2. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    I'm not sure I totally understand what's going on here but could your render texture object be simply rotated 180* / normals flipped?
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Render textures show you what the camera sees, from the point of view of the source camera, when placed in front of the target camera. In your case, the target camera is flipped relative to the source camera and so is the render texture, therefore the image will be flipped relative to the world. You need to scale it by -1 in X to get what you want.
     
    Last edited: Mar 4, 2019
  4. A_World_Maker

    A_World_Maker

    Joined:
    Apr 21, 2018
    Posts:
    214
    Cool, thanks for the tip
     
  5. A_World_Maker

    A_World_Maker

    Joined:
    Apr 21, 2018
    Posts:
    214
    That worked perfectly. It is understandable why the render would be flipped on the X axis as the camera has to render from a players perspective, not a mirrors perspective. Now I can proceed with installing security cameras that show correctly on the security camera monitors in the scene.