   [GLSL] Calculating Reflection vector for a cubemap
  I am attempting to do a reflective cube mapping my placing a sphere inside of a cube mapped environment. I believe I have most things working, but am not calculating the reflection vector correctly. From what I have been reading in online tutorials, the reflection vector is calculated by using the GLSL reflect() function, which takes the camera vector to the fragment, and the fragment normal. In order to find the camera vector, from what I'm reading (I'm very new to OpenGL and GLSL), you multiply the camera position in view space (0,0,0) by the inverse of the model view matrix, to find it's position in world space.Here is the relevant code from my vertex shader:normal = normalize(gl_NormalMatrix * gl_Normal);vec3 cameraPosition = vec3(gl_ModelViewMatrixInverse * vec4(0,0,0,1.0));cameraPosition = normalize(cameraPosition-gl_Vertex.xyz);vec4 reflection = vec4(reflect(cameraPosition.xyz, normal), 1.0);reflectDir = reflection.xyz;The resulting image is this:It looks more like the cube is inside the sphere and being "blown up", than it does the sphere being inside the cube. (the reason you just see a white background is because I haven't implemented the quad drawing yet). It also looks like the textures are being flipped in some odd ways.Anyone know what I may be doing wrong here?Thanks for the help.   
  Alright, I have a makeshift solution, but I'm not sure why it works:1. Make the reflection vector negative.2. Load the negative y face before the positive one.   ;Quote:1. Make the reflection vector negative.Maybe the reflect call takes the view vector (as in the vector from the camera to the vertex).You are computing the opposite direction (from vertex to camera):cameraPosition = normalize(cameraPosition-gl_Vertex.xyz);