Announcement

Collapse
No announcement yet.

Z-Up vs Y-Up, the solution to the debate lies within...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Z-Up vs Y-Up, the solution to the debate lies within...

    Saw an interesting post in the UE4 Facebook group today that made me enquire a little more into the Z-Up nature of Unreal Engine. I know when the engine went free there was a lot of (fruitless) debate about whether UE or *insert other random engine here* got it 'right' or 'wrong'. Asked a few questions and did a bit of reading, so here's what I found out and perhaps it'll settle the debate This isn't to start a flame war, but I honestly just found it interesting and figured some folks around here would too.

    ---

    The tale starts with 3DS Max. Released in 1990, it's designed and used primarily for architectural purposes. In Architecture, you typically start with your floor plan which would be plotted on a 2D grid first, X and Y. When it comes to extruding that up into a 3D model, you need the next dimension (Z) to be up. That fellow devs, is apparently why Z is up in 3DS Max. Makes perfect sense for it to be that way.

    In 1998 Maya is released primarily as an animation package. Animation at the time was typically in 2D, from the side-on. Think early Disney and other old animated titles done from a side-on perspective (like a 2D platformer). You start working in X and Y, and your new dimension Z becomes the depth. That would also explain why Maya is Y-Up.

    3DS Max was the modelling package of choice for most developers at the time, and as Unreal came out before Maya (and it's crazy ideas) - Unreal was done in Z-Up to match.

    ---

    As an afterthought, it does make more sense (at least to me) for a Games Engine to be Z-Up - especially in 3D. If you're working on any 3D title, you typically plan your levels from the top-down, not from the side-on. You box them out in X and Y first then proceed to the next logical dimension Z, which would be Up.

    Perhaps Tim can come here and enlighten us further, but honestly I think this about covers it. The dilemma is solved forever!

    #2
    3D co-ordinate systems have been around for eons longer than Maya / Max with Z typically always up...
    Curious to know what CryEngine uses because Unity matches Maya. Did Unity start life as a 2D engine?

    https://en.wikipedia.org/wiki/Cartes...ree_dimensions
    https://en.wikipedia.org/wiki/Three-dimensional_space
    Last edited by UnrealEnterprise; 07-07-2015, 09:58 AM.

    Comment


      #3
      It's all about whether you are thinking in screen space, or in world space.

      In screen space, Z as depth makes sense given X and Y screen coords - this is why a lot of rendering techniques have names like the 'Z buffer'. This is also acceptable for most 2d games since the camera perspective is effectively immutable.

      In world space, you generally want to build worlds like you would real world objects - and any good schematic treats the third coordinate as vertical. It makes sense to do it this way; if you were to define a rectangle in world space, you give it's width, breath, and then it's height. If you treat Y as vertical, you're hanging on to an anachronism that assumes the camera is still immutable* in order to make Z stay as depth - which doesn't play right with conventional thinking - and that conventional thinking has been around for centuries.

      *technically speaking, this is often sort of the case in renderers, that the world is orientated around the camera, but thinking about thing this way just isn't practical when it comes to implementing them on top of the renderer, so we assume the camera moves through static coordinates, making much more sense to the user.

      Comment


        #4
        Originally posted by TheJamsh View Post
        Saw an interesting post in the UE4 Facebook group today that made me enquire a little more into the Z-Up nature of Unreal Engine. I know when the engine went free there was a lot of (fruitless) debate about whether UE or *insert other random engine here* got it 'right' or 'wrong'. Asked a few questions and did a bit of reading, so here's what I found out and perhaps it'll settle the debate This isn't to start a flame war, but I honestly just found it interesting and figured some folks around here would too.

        ---

        The tale starts with 3DS Max. Released in 1990, it's designed and used primarily for architectural purposes. In Architecture, you typically start with your floor plan which would be plotted on a 2D grid first, X and Y. When it comes to extruding that up into a 3D model, you need the next dimension (Z) to be up. That fellow devs, is apparently why Z is up in 3DS Max. Makes perfect sense for it to be that way.

        In 1998 Maya is released primarily as an animation package. Animation at the time was typically in 2D, from the side-on. Think early Disney and other old animated titles done from a side-on perspective (like a 2D platformer). You start working in X and Y, and your new dimension Z becomes the depth. That would also explain why Maya is Y-Up.

        3DS Max was the modelling package of choice for most developers at the time, and as Unreal came out before Maya (and it's crazy ideas) - Unreal was done in Z-Up to match.

        ---

        As an afterthought, it does make more sense (at least to me) for a Games Engine to be Z-Up - especially in 3D. If you're working on any 3D title, you typically plan your levels from the top-down, not from the side-on. You box them out in X and Y first then proceed to the next logical dimension Z, which would be Up.

        Perhaps Tim can come here and enlighten us further, but honestly I think this about covers it. The dilemma is solved forever!
        Z-up makes more logical sense in three-dimensional games, but Y-up makes more sense in two-dimensional games.
        At the same time though, Y is up in MOST modeling packages. That being the case, it's much better for Y to also be up in a game engine. This coming from someone who personally prefers Z-up.
        Although, like I said Z–up is more logical, and it's way easier to make a modeling package stop being retarded and use Z-up than to do the same with a full-blown game engine.
        Last edited by Grimwolf; 07-07-2015, 12:03 PM.

        Comment


          #5
          Most programs give a choice now, but I think it should still be Z up. I believe that's mathematically correct as well

          Comment


            #6
            I never realized people had such issues with this stuff hahaha.

            Comment


              #7
              because Z up i always have problem with downloaded free rigged models. this models always for Y up, for example when i first create vehicle in maya i skin it for Y up but in final i MUST be reskin(from scratch) to z

              Comment


                #8
                There are two fairly reasonable ways to define a coordinate system for a 3D environment. Both build on the intuition we learned in school with graph paper, with X representing the horizontal coordinate, and Y the vertical coordinate.

                If you think of the world from an overhead perspective (like Google Maps), then the location of an object on the map is defined primarily by its X and Y coordinates, and its height above the map by Z. In my intuition, this was the most sensible coordinate system for Unreal. This standard was earlier chosen by AutoCAD deriving 3D data from 2D floor plans, and continued with Autodesk's 3D Studio.

                If you think of the world from the perspective of the screen, then X is right, Y is up, and Z is forward. If you further assume you're level and facing north, then that defines the other popular coordinate system. Historically, its use derives from OpenGL, which was derived from SGI's IRIS GL, and is logical if you're mapping a default observer in a 3D world into screenspace. Maya was initially developed for SGI hardware, so it took this path too.

                Comment


                  #9
                  Most computer graphics literature use Z forward instead of Z up.

                  OpenGL is right hand system, which means going forward is -Z, is a bit annoying when you combine with other parts of the engine. DirectX is left hand, which is more "correct". Anyway, it's good to stick with one convention, unlike some other engines like Gamebryo, which uses different coordinate systems depending on which layer u are using

                  Comment


                    #10
                    I would love it if there was a way to abstract away which letter is 'UP'. I know that would be a technically challenging thing to do with so many parts of the engine hard coded to assume that the third value of a vector is up. It would probably involve having a Vector3 data type that had an UP property that you could change to Z or Y and would do some internal swizzling. It could even hurt performance if that was the case. But an editor setting would be nice.

                    Maybe we could have a poll and vote on it. I'm in the Y camp because I'm a maya guy.
                    Visual Effects Artist, Weta Digital, Wellington New Zealand
                    BLOG www.danielelliott.co.uk
                    @danielelliott3d https://twitter.com/danielelliott3d
                    Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
                    2015 Showreel: https://vimeo.com/116917817

                    Comment


                      #11
                      Originally posted by protegedev View Post
                      Most computer graphics literature use Z forward instead of Z up.
                      That's probably because graphics wise, you're talking about screenspace. At which point, it makes sense for Z to be forward (aka, away from the screen).

                      Originally posted by dokipen View Post
                      Maybe we could have a poll and vote on it. I'm in the Y camp because I'm a maya guy.
                      Unreal-ated (heh) - but that's an awesome showreel in your sig! I figure changing the coordinate system now would only cause more issues than it would solve. Since the FBX exporter has a checkbox to swizzle coordinates anyway, it probably doesn't matter too much anymore.

                      ---

                      Thanks for the input on this btw Tim, if nothing else it's interesting trivia behind the engine!

                      Comment


                        #12
                        Originally posted by BEFaughnan View Post
                        I never realized people had such issues with this stuff hahaha.
                        Same, been using maya for years and can just change it when needed... no really big deal about it .

                        Comment


                          #13
                          FPS-Y doesn't sound nearly as good as FPS-Z (eg. Tribes)

                          Comment


                            #14
                            Also note that the 'Y' axis is used to denote looking up and down in 3D games, and of course, we have the Z buffer, which deals with depth.

                            It's a shame that Epic don't give you the choice when setting up a project.

                            Comment


                              #15
                              Originally posted by Jimmy_Jazz View Post
                              Also note that the 'Y' axis is used to denote looking up and down in 3D games, and of course, we have the Z buffer, which deals with depth.
                              This isn't really correct. Looking up and down is pitch, and corresponds with a rotation around the Y-axis in classical mechanics (and also in most games, as well as the Unreal Engine). You're sort of looking up and down the Z-axis as a result, but it doesn't really make any sense to think about it this way because it's a rotation, not a translation.


                              Yaw is a rotation around the Z-axis and Roll as a rotation around the X-axis.


                              The Z-buffer deals with depth because as mentioned before, it is with regard to screen space, not game space. These are two different concepts and the coordinate systems are not the same.

                              Comment

                              Working...
                              X