My cube is not a cube ?

Hey Guys,

I got something weird going on.
I defined 4 viewports for each corner of the window in where i defined a rotating cube (which i scaled by glscale).

The strange thing is that the cubes don’t look really like a cube but more like a cube/rectangle… It seems my vertexes are not good defined but I can’t find the error.

Besides that, if the cube rotates, I notice a distortion on the corners of the cube.

Is there anybody who can give a hand to this rookie starter ?

Code can be found here:
http://thepartybrothers.webtrip.ch/temp/intro/SiteTro.rar

Thanks a lot,
DeXtr0

There is nothing wrong with your code.
If you remove either the rotation about the x axis or the y axis of the cubes, you will see that the outlines of the cube remain strictly rectangular, but the texturing gives you the ‘impression’ that it is being stretched somehow.

The reason for this, is that the human eye is not used to seeing orthographic projections.

Try inserting

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-0.1f,0.1f,-0.1f,0.1f,0.4f,100.0f);
glTranslatef(0.0,0.0,-5.);

at the top of the DrawGLSceneCubes function.

Another hint:
Set the filter value to 2 and change the minification filter from GL_LINEAR_MIPMAP_NEAREST to GL_LINEAR_MIPMAP_LINEAR, the transitions between the mipmap levels will be smoother.

Greetz,

Nico

Hey Nico,

the tip you gave me is awesome…

Thnx mate, really appreciated.

Regards,
DeXtr0