- Home /
Images are, in fact, upside down on standard objects?
I just noticed that:
sit your editor in the normal correct way with z forward (z extends away from you, and obviously Y is upwards and x is to your right, as when drawing an "x y graph", per René, in kindergarten)
make a normal standard plane or cube. put any image on it (png, texture, material)
in a word, the image is upside down. See Aldo's example:
you have to typically set the scale to -1y in the material to use the standard unity objects in the obvious way
So I was wondering ...
is there "absolutely no meaning to this" ie ten years ago in Unity someone happened to type out the standard objects that way, and they have not bothered changing it until now.
Or - is there something I don't know about shaders, textures, mesh, rendering, OpenGL, or whatever else, that suggests this way??
Obviously this causes no great problem, I'm just curious. Can anyone cast any light on this? {rendering joke.} Someone from Unity? Cheers! Surprisingly I could not find any similar question on this
Answer by aldonaletto · Nov 30, 2012 at 01:03 PM
Funny thing! I tested this in my PC: created the five primitives, added a material with a face texture (ok, my image files could have more options...) and aligned the camera to look in the forward direction - the objects are thus showing their back faces to me:
And these are the same objects, but the camera now is looking in the -Z directions - the objects are thus showing their front faces to me now:
From these images, the plane, the cylinder and the cube apparently were designed to show their forward faces to us (their forward directions opposed to the camera), and their top faces also appear ok when looked in this direction. The cylinder shows two images along its circumference, thus the same face can be seen in both directions. Mysteriously, the sphere and the capsule are oriented sideways: the sphere looks forward in the X+ direction, while the capsule forward face points -X.
My opinion is that no special attention was paid to this particular subject when the primitive creators were designed - at least in the PC version, the images aren't mirrored, thus rotating the object solves the problem.
NOTE: Although not so closely related to this, the cubemaps in Unity PC show a weird behaviour. I tried to create a cubemap with the skybox images to reflect the sky, and found that the images became flipped horizontally when assigned to the it. I tried also to get a cubemap without using Camera.RenderToCubemap (which works fine), but again the images resulted flipped - I had to reverse the lines to get the desired cubemap.
exactly, when you have the camera facing normally forward, the face is (in a word) upside down on the plane and cube (as in your top image), and other objects are irregular.
"$$anonymous$$y opinion is that no special attention was paid to this particular subject"
I am inclined to share your opinion. I just wonder if there's some gotchya we don't know about...
(eg "everyone knows that in openGL you traditionally start textures as far away as possible" or something!!)
I guess so far we have two votes for "no special attention paid" ! thanks man
Answer by Owen-Reynolds · Nov 30, 2012 at 03:44 PM
This is standard unwrapping stuff. Take a cube. There are lots of reasonable ways to unwrap it, rules for what upside-up is.
For examples, a 6-sided die (anything with all sides different) needs a standard cross-shaped unwrap (imagine cutting a box to lie flat.) A crate probably has top and bottom the same, and all sides the same, so can be unwrapped onto a 2-squares rectangle. The unity cube has "each side mapped onto entire texture," which is the about the simplest.
No one is going to use the Unity plane for real -- it's 2 units wide/tall and has 121 verts -- better to import a 1x1 unit 4-vert plane. So the unwrap isn't important.
Your answer
Follow this Question
Related Questions
instantiate works on one but not other object 0 Answers
Cube fall to the plane and gets Velocity 1 Answer
Spheres multi render with mapcubes 1 Answer
How do you create a sphere form 6 planes? 0 Answers
How to make a "pressure sensor" of sorts that when rolled over switches to another scene 2 Answers