I implemented a skybox, and was trying to create a cube map to implement reflections (I put the 6 textures of my skybox in a cube map).
I realized that the reflections of the skybox in the objects inverted left and right correctly but also up and down…
Which made me wonder how come “correct” mirrors seem to be reversing left and right but not up and down:
I’m still wondering if this effect has to be taken into account while building cube maps, or whether I just screwed up something else.
well, obviously, I shouldn’t have to take this effect into account (it has to do with psychology not optical/physics). I guess, I’m missing something about building correct cube maps.
A scene, seen through a lens, will be turned upside down. This means it’s been mirrored two ways, both in X and in Y (say). A scene, seen through a mirror, will only mirror one way, say X only. Unless you run it through two mirrors
This is all in your projection math and how it mirrors optics (or doesn’t). There’s no psychology involved.
Actually mirrors dont “reverse” anything, a vector pointing to the left has its reflection still pointing to the left, and a vector pointing up has its reflection still pointing upward (a lense reverse up/down and left/right). Only the unit vector pointing toward the mirror gets reversed.
If we try to mentally match a real object and its reflection (by matching front pointing vector and its reflexion), we can either imagine that we turn vertically by 180deg (in which case we come to the conclusion that left and right are reversed), or we can also turn 180deg horizontally (back flip), in which case we would come to the conclusion that up and down are reversed.
Anyway, not much to do with opengl…