If I look at a textured sphere from outside, and compare it to what a I see from inside, the images will appear to be reflected WRT each other. For example, text that is readable when viewed from outside will appear "backwards" when viewed from inside, since this is the same as if I am inside a store, look out the store window, and attempt to read what is written on the store window -- it appears reversed!
Cube maps are constructed in jReality based on the assumption that the images should appear correct when the cube is viewed from outside. If would probably be good if there were a rendering hint to flip this assumption, so that they appear correct for the inside viewer. But such a rendering hint does not currently exist.
The necessary code for the JOGL backend to implement this reversal is given by the following patch:
Code: Select all
Index: src-jogl/de/jreality/jogl/JOGLSkyBox.java
===================================================================
--- src-jogl/de/jreality/jogl/JOGLSkyBox.java (revision 5477)
+++ src-jogl/de/jreality/jogl/JOGLSkyBox.java (working copy)
@@ -100,7 +100,7 @@
gl.glLoadTransposeMatrixd(P3.extractOrientationMatrix(null, w2c, P3.originP3, Pn.EUCLIDEAN), 0);
double scale = (cam.getNear() + cam.getFar())/2;
- gl.glMultTransposeMatrixd(P3.makeStretchMatrix(null, scale),0);
+ gl.glMultTransposeMatrixd(P3.makeStretchMatrix(null, new double[]{-scale, scale, scale}),0);
for (int i = 0; i<6; ++i) {
jogltex.setImage(imgs[i]);
Texture2DLoaderJOGL.render(gl, jogltex);