Frustum - problem with z dimension I'm beginner in OpenGL and I stumbled into a problem. I'm in OpenGL 2.1 for the time being, if that's of any help. 

I set my Frustum as such:

glFrustum(-1366, 1366, -768, 768, 1, 20000);


Now, when I create a cube from quads like this:

0.0, 500.0, 0.0
500.0, 500.0, 0.0
500.0, 0.0, 0.0
0.0, 0.0, 0.0
0.0, 500.0, 500.0
500.0, 500.0, 500.0
500.0, 0.0, 500.0
etc.


It is not a cube, as I expected. It's extremely stretched along the z axis.

Here's a screenshot of how it looks now: https://www.dropbox.com/s/diznfumtev7g259/Screenshot%20from%202016-02-26%2017%3A01%3A58.png?dl=0 (I removed one of the faces temporarily)

The shape starts to resemble a cube a bit when I change the vertices to:

0.0, 500.0, 0.0
500.0, 500.0, 0.0
500.0, 0.0, 0.0
0.0, 0.0, 0.0
0.0, 500.0, 0.3
500.0, 500.0, 0.3
500.0, 0.0, 0.3
etc.


Code related to this (I am translating this from assembly which I am actually using).

Matrices setup on initialization:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1366.0, 1366.0, -768.0, 768.0, 1.0, 20000.0);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();


Transformations of the cube inside the "render()" function:

glLoadIdentity();
glTranslated(1000.0, 500.0, 0.0);
glRotated(degrees, 0.0, 0.0, 1.0); // degrees is +=2 every frame
glTranslated(-250.0, -250.0, distance); // distance is -=0.001 every frame


There are no other matrix operations in the code.

The code uses GLUT to initialize a window with double buffer and depth buffer. Depth testing is enabled.

It all seems to work as expected, the rotation is ok, movement also. I am only troubled by the fact that when I define a 500.0x500.0x500.0 cube, the actual output is not a cube.

What am I doing wrong? How to fix this?
Okay. So after 6 hours of tinkering with my code, trying different approaches and googling for solutions, I found this page:

http://www.glprogramming.com/red/chapter03.html

There is a short C listing which put me on the right track to solve this.

What I did wrong was that I should have set the frustum to something like this:

GLdouble x0 = -(1366/768);
GLdouble x1 = 1366/768;
glFrustum(x0, x1, -1, 1, 1, 100);
// the last two values aren't critical, as long as they are positive


But before that, I should have set the glViewport properly, before setting up the frustum:

glViewport(0, 0, 1366, 768);


I didn't do it and that's why my code produced such weird results.

Now I can create a unit cube with following vertices:

0.0, 1.0, 0.0
1.0, 1.0, 0.0
1.0, 0.0, 0.0
0.0, 0.0, 0.0
0.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 0.0, 1.0
0.0, 0.0, 1.0


And it will display properly as a cube of size 1 in every direction.