PDA

View Full Version : skybox and mirrors...



zwaffle
09-17-2002, 01:55 PM
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:
http://math.ucr.edu/home/baez/physics/General/mirrors.html http://www.cogsci.ecs.soton.ac.uk/cgi/psyc/ptopic?topic=mirror-reversal

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.

Any thoughts?

thanks,

-zwaffle

zwaffle
09-17-2002, 02:47 PM
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.

jwatte
09-18-2002, 11:15 AM
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.

zwaffle
09-18-2002, 12:09 PM
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...