Problem: Many images of the Earth are mirror images

Randall Maas 12/21/2013 8:45:51 AM

I'm pretty sure that most people simply do not know the topology of the earth. Judging by the number of times that I see a globe horizontally flipped, and how many years that these globes remain uncorrect, I suspect that people don't see this mirroring as wrong. (This leads me to believe that people do not know how the earth looks, is oriented, and rotates.. and how this is connected to common place phenomenon)

Example 1: GLSL examples

An example in GLSL, that Apple has shipped for years. (Original copyright: 2002, Apple's mark: 2008) Along with one flipped it so that it is not longer a mirror image:

The earth as it came with GLSL demos
The earth as it should look

(Notice that the sun is lighting it from the west and darkness is in the east ? Let's just pretend that midday is over central america, ok?)

Example 2:

Another example (image originally from http://www.zugakousaku.com/)

Let's flip this one so that it is not longer a mirror image either:

(This is also true in Zugakousaku's other screen saver: Odyseey of Boys and Girls)

Here's what to fix:

As a courtesy, here's what to changes need to happen to fix them.

GLSL change

In the GLSL shading example, the fragment shader has a line, like so, that specifies the texture coordinates:


Diffuse = max(dot(lightVec, tnorm), 0.0); TexCoord = gl_MultiTexCoord0.st; gl_Position = ftransform(); }

Change this to:


Diffuse = max(dot(lightVec, tnorm), 0.0); TexCoord = gl_MultiTexCoord0.st * vec2(-1.0, 1.0); gl_Position = ftransform(); }

Fixes to Zugakousaku

As I covered last time, just make sure you're culling the back faces. Zugakousaku screen savers seems to have two different problems that are solved by this.

In one of Zugakousaku screen savers , the sphere is transparent . Due to the lighting, you primarily see the backside, hence the flip. By removing the back faces, only the front is seen.

In the other screen saver, the culling is set to the front. Again, you see the backside, and making the earth seem flipped.