Hi, in my scene I have two 2D squares and a 3D model. The model is centered inside one of the square using "glTranslate" with empiric values.

The problem is that when I resize the window the model is centered inside the square no more. I've tried using aspect ratio inside "glTranslate" but it's not work as I want.
Someone can help me?

Here is the code:

Code :
[COLOR=#7d4725][COLOR=#000000]    [/COLOR][COLOR=#490085]glMatrixMode[/COLOR][COLOR=#000000]([/COLOR]GL_PROJECTION[COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#490085][COLOR=#000000]    [/COLOR]glLoadIdentity[COLOR=#000000]();[/COLOR][/COLOR]
[COLOR=#4700de][COLOR=#000000]    [/COLOR][COLOR=#490085]glOrtho[/COLOR][COLOR=#000000](-[/COLOR]20.0[COLOR=#000000], [/COLOR]20.0[COLOR=#000000], -[/COLOR]20.0[COLOR=#000000], [/COLOR]20.0[COLOR=#000000], [/COLOR]1.0[COLOR=#000000], -[/COLOR]30.0[COLOR=#000000]);[/COLOR][/COLOR]
 
[COLOR=#490085][COLOR=#000000]    [/COLOR]glMatrixMode[COLOR=#000000]([/COLOR][COLOR=#7d4725]GL_MODELVIEW[/COLOR][COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#490085][COLOR=#000000]    [/COLOR]glLoadIdentity[COLOR=#000000]();[/COLOR][/COLOR]
 
[COLOR=#7d4725][COLOR=#000000]    [/COLOR][COLOR=#490085]glBegin[/COLOR][COLOR=#000000]([/COLOR]GL_QUADS[COLOR=#000000]);[/COLOR][/COLOR]
        [COLOR=#490085]glColor3f[/COLOR]([COLOR=#4700de]0.1[/COLOR],[COLOR=#4700de]0.1[/COLOR],[COLOR=#4700de]0.4[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR](-[COLOR=#4700de]17.0[/COLOR],[COLOR=#4700de]17.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]0.0[/COLOR],[COLOR=#4700de]17.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]0.0[/COLOR],[COLOR=#4700de]0.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR](-[COLOR=#4700de]17.0[/COLOR],[COLOR=#4700de]0.0[/COLOR]);
 
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]1.0[/COLOR],[COLOR=#4700de]17.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]18.0[/COLOR],[COLOR=#4700de]17.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]18.0[/COLOR],[COLOR=#4700de]0.0[/COLOR]);
        [COLOR=#490085]glVertex2d[/COLOR]([COLOR=#4700de]1.0[/COLOR],[COLOR=#4700de]0.0[/COLOR]);
    [COLOR=#490085]glEnd[/COLOR]();
 
 
 
 
 
[COLOR=#7d4725][COLOR=#000000]    [/COLOR][COLOR=#490085]glMatrixMode[/COLOR][COLOR=#000000]([/COLOR]GL_PROJECTION[COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#490085][COLOR=#000000]    [/COLOR]glLoadIdentity[COLOR=#000000]();[/COLOR][/COLOR]
    [COLOR=#490085]gluPerspective[/COLOR]([COLOR=#4700de]60[/COLOR], ([COLOR=#7d1bae]GLfloat[/COLOR])[COLOR=#438288]wwidth[/COLOR] / ([COLOR=#7d1bae]GLfloat[/COLOR])[COLOR=#438288]wheight[/COLOR], [COLOR=#4700de]1.0[/COLOR], [COLOR=#4700de]100.0[/COLOR]);
[COLOR=#4700de][COLOR=#000000]    [/COLOR][COLOR=#490085]gluLookAt[/COLOR][COLOR=#000000]([/COLOR]20.0f[COLOR=#000000], [/COLOR]5.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000], [/COLOR]1.0f[COLOR=#000000], [/COLOR]0.0f[COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#008c00][COLOR=#000000]    [/COLOR]//gluLookAt(0.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 5.0f);[/COLOR]
[COLOR=#008c00][COLOR=#000000]   [/COLOR]// glTranslatef(0.0f, 0.0f, 2.0f);[/COLOR]
 
[COLOR=#490085][COLOR=#000000]    [/COLOR]glMatrixMode[COLOR=#000000]([/COLOR][COLOR=#7d4725]GL_MODELVIEW[/COLOR][COLOR=#000000]);[/COLOR][/COLOR]
[COLOR=#490085][COLOR=#000000]    [/COLOR]glLoadIdentity[COLOR=#000000]();[/COLOR][/COLOR]
 
[COLOR=#490085][COLOR=#000000]    [/COLOR]glPushMatrix[COLOR=#000000]();[/COLOR][/COLOR]
    [COLOR=#490085]glScalef[/COLOR]([COLOR=#4700de]0.5[/COLOR], [COLOR=#4700de]0.5[/COLOR], [COLOR=#4700de]0.5[/COLOR]);
[COLOR=#4700de][COLOR=#000000]    [/COLOR][COLOR=#490085]glRotatef[/COLOR][COLOR=#000000]([/COLOR]180.0[COLOR=#000000], [/COLOR]0.0[COLOR=#000000], [/COLOR]1.0[COLOR=#000000], [/COLOR]0.0[COLOR=#000000]);[/COLOR][/COLOR]
    [COLOR=#490085]glRotatef[/COLOR](-[COLOR=#4700de]20.0[/COLOR], [COLOR=#4700de]0.0[/COLOR], [COLOR=#4700de]0.0[/COLOR], [COLOR=#4700de]1.0[/COLOR]);
[COLOR=#438288][COLOR=#000000]    [/COLOR][COLOR=#490085]glTranslatef[/COLOR][COLOR=#000000]([/COLOR][COLOR=#4700de]0.0f[/COLOR][COLOR=#000000], [/COLOR][COLOR=#4700de]7.0f[/COLOR][COLOR=#000000]+([/COLOR]wwidth[COLOR=#000000]/[/COLOR]wheight[COLOR=#000000]), -[/COLOR][COLOR=#4700de]16.0[/COLOR][COLOR=#000000]+([/COLOR]wheight[COLOR=#000000]/[/COLOR]wwidth[COLOR=#000000]));[/COLOR][/COLOR]
    [COLOR=#438288]cycle1[/COLOR]->[COLOR=#275a5e]drawCycle[/COLOR]();
 
[COLOR=#490085][COLOR=#000000]    [/COLOR]glPopMatrix[COLOR=#000000]();[/COLOR][/COLOR]