Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: makeshiftwings on July 12, 2012, 03:30:03 PM
-
Something I've always found strange - why is NGUI flipped in the editor? You need to look at it down the negative Z axis for it to be facing the right way, and yet when you're actually setting values it still treats it as if you're looking at it normally; with positive Z being further away from the camera and positive X being to the right, rather than the way it is in the editor, with positive Z being closer and positive X pointing to the left. I never could figure this out exactly; what's the deal?
-
Just as an experiment I tried rotating the UI Root 180 degrees on the Y axis so that everything is facing correctly, and everything seems to work fine still, so why does the default UI Root have a flipped Z-axis?
-
Huh? UIRoot doesn't have a rotation.
-
Yes, UIRoot's default rotation is 0,0,0, I was just saying that if I changed it to rotate around the Y-axis 180 degrees, it fixed the problem. When I create a new UI, everything in the editor is flipped backwards when looking down the Z-axis (in other words, it appears to be rotated 180 degrees about the Y-axis, even though all of the objects have zero rotations in the inspector). In order to see the UI properly in the editor, I have to look at it down the -Z axis instead of the +Z axis. I assumed it was like this for everyone; maybe it's just something weird in my setup? All the example projects loaded like that as well though. I was saying I could get it to look correct by rotating the UIRoot around the Y-axis since the rest of the UI is a child underneath it. Am I the only one who sees it backwards?
-
Uh... rotate your scene view camera. When looking at the gizmo in the top-right corner, you should see this:
-
This is because Unity's default orientation in the Scene View is looking back at the origin from the middle of (+X,+Y,+Z), which is actually "backwards" in terms of proper scene orientation where +Z is "deeper" into the scene and -Z is "closer" to the camera.
Typically world space with a default orientation camera is thought of as:
-/+ X : left/right
-/+ Y : down/up
-/+ Z : closer/further from camera
Blame Unity's default orientation when you click the middle of the Scene view axis indicator gadget for making you think this is backwards.
-
Thanks JRoch, that's the explanation I was looking for. I knew it looked correct when you changed the scene orientation to "Back" instead of "Front", but that's why I assumed it was backwards. I get it now... you're right, it's because Unity's default perspective view is looking at the scene backwards.