Search Unity

Using two cameras to blend regular 2D orthographic with 3D isometric orthographic elements

Discussion in '2D' started by PhilippCh, Jul 29, 2016.

  1. PhilippCh

    PhilippCh

    Joined:
    Jun 14, 2013
    Posts:
    19
    Hi there!

    First of all, please don't mind the ripped tileset from Prison Architect, they are just my personal placeholders.

    I'm currently trying to blend 2D (X/Y plane) and 3D models using two cameras.



    MainCamera is a 2D orthographic camera with default settings and renders everything besides the car, which is an actual 3D model. To match the orientation of the sprite images, I need to render the car in an orthogonal mode with the camera looking down on it at an angle of around 30deg. I can't rotate the car itself to simulate the 30deg angle on the MainCamera that is looking straight, because it would break the car's display if I needed rotation on the X axis. The orthogonal camera for 3D objects is matching the MainCamera's properties (Scale, Position with Offset) to show the exact same area of the game.



    Now, my problem is that whenever I move my main camera, the car seems to translate a bit further than the background. I put this down to the two camera frustums not aligning perfectly, as seen in the following images, but am unsure how to fix it.







    Does any of you have any idea for how to manage situations like these?

    Cheers
    Philipp