Search Unity

Colored z x and y for faster learning

Discussion in 'General Discussion' started by wicky7772, Apr 20, 2020.

  1. wicky7772

    wicky7772

    Joined:
    Apr 16, 2020
    Posts:
    6
    An idea for the developers.

    I just started using unity its great i have an idea to make learning considerably easier and quicker it took me a while to figure out which way was x,y and z a thought is to have them as colored letters matching the drag arrows this will make it easy to remember and use when changing scales and stuff or writing code as well.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    Red, Green, Blue. RGB.
    Corresponds to X, Y, Z. XYZ.

    Therefore,

    X is Red, Y is Green, Z is Blue.
     
  3. ZombieTFK

    ZombieTFK

    Joined:
    Sep 6, 2016
    Posts:
    55
    We have this little guy in the corner of the inspector if you get lost.

    upload_2020-4-20_11-8-40.png

    On a somewhat related note, I find using doing stupid hand gestures can be helpful in keeping track when it comes to vectors and figuring out which axis means what when rotating or using like Vector3.up, Vector3.forward etc :D

    blogentry-1-0-69344400-1444420060_thumb.jpg
     
    Joe-Censored and Aetherial87 like this.
  4. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    The colors for XYZ are RGB.
    The directions are the most logical: X is right and Y is up, as it is on each and every 2d function graph; and the most natural direction for rest Z-axis is forward.
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    While coloring of axes is standard across pretty much all software, directions are not.

    DirectX:
    X is right, Y is up, Z is forward.
    OpenGL:
    X is right, Y is up, Z is backward.
    Unreal engine:
    X is forward, Y is right, Z is up.
    Unity engine:
    X is right, Y is up, Z is forward.
    Blender:
    X is right, Y is forward, Z is up (I believe).
     
    Joe-Censored, Circool and Ryiah like this.
  6. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    You're right on this, just as confirmation.
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You'd think something like this would be standardized by now.

    My favorite is when the rotations are in the reverse direction.
     
  8. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    It's been a particular pain in the butt for me last few days. Exporting a hundred terrain tiles from world machine which has flipped orientation to unity. You can set the orientation when exporting a mesh, but not bitmaps. So then I have to draw a diagram so I put things in the right spot.
     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    Not going to happen, as multiple different fields have different conventions.

    For some funny examples...
    For example, on some system in screen coordinates Y points down.
    I suppose this is because upper rows have lower memory address.
    Speaking of bitmaps, in bmp format scanlines are stored from bottom to top, which is the opposite direction compared to screen memory layout.
     
  10. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    blah blah blah. I wanna speak to the manager!

    (sarcasm)
     
  11. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    Untiy's editor GUI works like this.


    X forwards, Y right and Z up has a bunch of advantages in 3D games. Most movement and spatial reasoning and whatnot is going to be on the flat plane. So you get to do:

    Code (csharp):
    1. movement = (input.x, input.y);
    instead of
    Code (csharp):
    1. movement = (input.x, 0, input.y);
    We've made two top-down games in a row, and there's so much code dealing with converting between 3D vectors and 2D xz Vectors.

    for 2D sidescrolling games, though, we really want Unity's current system.


    I'd be really happy if we could ditch the implicit conversion between Vector2 and Vector3, and add swizzles instead.
     
  12. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    Code (csharp):
    1.  
    2. movement = forward * input.y + right * input.x;
    3. [code]
     
  13. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    How standard is a left hand coordinate systems among those? I'm used to using right handed coordinate systems in the motion capture software that I have used.
     
  14. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    DirectX is left-handed.
    OpenGL is right handed.
    Blender is Right-Handed.
    Unreal is left-handed.
    Unity is left-handed.

    The thing is, in case of graphical APIs themselves, being left/right handed is not set in stone, and you can use right handed transforms in DirectX, and left handed ones in OpenGL, but you'll need to alter projection matrix at the very last step.