Search Unity

Default Scene settings seems backwards

Discussion in 'Editor & General Support' started by wolflogic, Nov 8, 2011.

  1. wolflogic

    wolflogic

    Joined:
    Oct 24, 2011
    Posts:
    7
    Hi all,

    This is probably just me thinking about it wrong, since noone else seems to have complained, but does the default settings for a scene seem a bit backwards to anyone else?

    If you create a new scene, you have a camera, and an empty scene. The Camera is at z:-10. If you rotate you can see that the camera is facing into the positive z axis.

    Create a cube. Put it at 0,0,0. The camera can see it. Use the scene view gizmo in the top right and set the view to be on the Z axis "Front". Select the cube, move it to the left. It actually moves to the right in the camera's view, obviously because to the camera that is what is happening.

    Is it just me, or does this seem strange? Maybe it's just me being used to Blender and other 3D apps where "front" view indicates looking at the front of the model, and usually the camera will be in this plane looking at it. So "front" and "camera" view will usually look at the same side of the object more or less.

    You can obviously change this by rotating the camera 180 degrees and moving it into the positive z axis, but then whenever you create an object (3D Text for example) you're no longer looking at it's "front" in camera view, but at it's back.

    This layout seems counter intuitive to me, and I can obviously "deal" with it, I'm just confused as to why it's set up this way. The only think I can think is that they wanted the Z axis units to become positive the further away from the camera they are, but that also seems a bit strange, as usually Z index is closer to the camera the higher the number. Weirdness.
     
  2. profanicus

    profanicus

    Joined:
    Nov 23, 2009
    Posts:
    295
    My guess is that the main camera is created facing forward (+Z axis) because it is a game object like any other, and they all get created with zero rotation. Also in a lot of 3d games, having the main camera behind your subject and looking forward is what you want anyway - think of fps, 3rd person, driving, flight sim etc. for example.

    Oh and welcome to the forums :)
     
    Last edited: Nov 8, 2011
  3. wolflogic

    wolflogic

    Joined:
    Oct 24, 2011
    Posts:
    7
    Hey, thanks for the welcome :)

    I suppose that makes sense from FPS/Driving etc games. I wasn't considering that, as I usually play 2D RPGs and platformer/sidescrollers and have done a bit of 3D modeling and a lot of web stuff with z ordering (larger number is closer to the viewer) so I totally forgot about the way it might work in games where the camera is the viewer.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    actually it makes completely sense. while you realized correctly that z indexes grow as they come closer you seem to have forgotten that you draw the stuff in 'furthest away to closest' order which means from largest z to 0 (as you can't make infinite 0 to make the value grow as it gets closer)

    But the real reason its like this is actually 2D:

    Screen coordinate systems have x on the horizontal, y on the vertical. That leaves in or out of screen for z and as the human is just better in thinking in positives than negatives, 'into the screen' is the positive z direction on more or less all engines (positive values also make sense to think of z as 'distance away from me' which can never be negative. In early days additionally the usage of unsigned data types for the measure additionally made it a good idea)
     
    Last edited: Nov 8, 2011
  5. wolflogic

    wolflogic

    Joined:
    Oct 24, 2011
    Posts:
    7
    Ahh, right, I see what you're saying there then. Thinking of it that way makes more sense, you're right. I suppose it's easier to not deal with negatives, and to view the z value as a distance away from origin point it makes more sense in a "humans thinking" way to assume that number is positive and increasing "here, 10m, 20m, 30m, etc". Hmm.

    I still think it'd be a bit more helpful if the "front view" corresponded to the camera position at default, starting at 0 and looking away into positive Z in this case, but I suppose when you get to the point where the camera is possibly moving all over the place an in all 3 dimensions and rotations, "front" in the editor vs front in the camera is pretty pointless anyway.

    Thanks for the replies guys, I understand the -why- now at least, and can work with this. :)
     
  6. ocelot

    ocelot

    Joined:
    Jul 7, 2009
    Posts:
    75
    I've wondered about this, too. we always have to rotate everything brought in from Maya 180 degrees, or reorientate the camera.