Splitting the screen

I’m trying to write a molecular visulization program. I need to be able to show the molecule in stereo. So, I’m splitting the screen in half with glScissor, and then creating two veiwports, and drawing to each. My problem is that when I split the 600x600 window, I get 300x600 viewports and the molecule gets squished, which makes it futile. I tried using glScalef, to double the x co-ordinates, but it distorts the molecule completely.
I think I’ve messed up with the projection matrix and the matrix view matrix. I’m really quite confused! Help!!! :-}

Any chance of me getting a reply?
The odds are 2 to the 23213224 power to 1 and rising
and that’s the the hyperiprobability drive off!

4 each scissor region use a diffirent viewport

sorry i also remembered u need to change the aspect ratio of both your viewports
eg gluPerspective( FOV, viewportwidth/viewportheight, near, far )

I can’t seem to get it to work!
Here’s the code for that bit.
I can’t get it to stop squishing the view.

const float StereoAngle = 2.5;

GLint vp[4];glGetIntegerv(GL_VIEWPORT,vp);
int GeomXsize = 600; //int(vp[3]);
	int GeomYsize = 600; //int(vp[4]);
int hx = GeomXsize/2;int yx = GeomYsize;
int dx,mx;
if(SENSE)
{
	dx = 1;
	mx = hx+1;
}
else
{
	mx = 1;
	dx = hx+1;

}

glPushAttrib(GL_VIEWPORT_BIT);
glEnable(GL_SCISSOR_TEST);
glViewport(dx,0, hx,yx);
glScissor (dx,0, hx,yx);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glRotatef(-2.0*StereoAngle, 0.0, 1.0, 0.0);
glMatrixMode(GL_MODELVIEW);
draw_scene(w,mouse_x,mouse_y);
	glFlush();
glMatrixMode(GL_PROJECTION);
glRotatef(StereoAngle, 0.0, 1.0, 0.0);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();

glViewport(mx,0, hx,yx);
glScissor(mx,0, hx,yx);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glRotatef(StereoAngle, 0.0, 1.0, 0.0);
glMatrixMode(GL_MODELVIEW);
draw_scene(w,mouse_x,mouse_y);
glFlush();

glPopMatrix();

glDisable(GL_SCISSOR_TEST);
glPopAttrib();

}

You need to use gluPerspective to setup a perspective projection.
And NEVER use glRotate in the GL_PROJECTION matrix! Just use glTranslate on the geometry, to simulate the two eyes.

What’s wrong with glRotate?
How would I use glPerspective?
I haven’t a clue…not to fluent with opengl, as you can see.
I tried glPerspective(360,0.5,0,0)
didn’t make any difference.

And how would I use translate to rotate?

Thanks!

Help?

Sorry, didn’t see that post…
Well, glRotate and stuff are used in the GL_MODELVIEW Matrix.
The Projection matrix needs to be set up okay, in order to let opengl perform the lighting and other stuff like fog. gluPerspective now creates such a matrix that you can use in the GL_PROJECTION matrix.
You need to specify the ratio somewhere in the function. That is window_width/window_height. So, for your windows, the ratio should be as you used it 0.5. But the fov is not okay. You can specify values between 0 and 180 there, if I remember it correctly. Common values are 60 between 90. This value specifies the angle you can see between left border of the viewport and right border. So 360 degrees would show all the world around you squished to a little rectangle.