   please help~!!!!!!!! Question with the viewport viewing two viewport in one screen.
  Hi, I am trying to view 2 viewport in one screen top / bottom or left / right.   My code is as follows.-----------------------------------------GLvoid ReSizeGLScene(GLsizei width, GLsizei height)// Resize And Initialize The GL Window{if (height==0)// Prevent A Divide By Zero By{height=1;// Making Height Equal One}//glViewport(0,0,width,height);// Reset The Current ViewportglViewport (0, 1, width, (height/2)-1);glMatrixMode(GL_PROJECTION);// Select The Projection MatrixglLoadIdentity();// Reset The Projection Matrix//glFrustum(-1.0,1.0,-1.0,1.0,1.5,100.0);//gluPerspective(60.0f, (GLfloat) width / (GLfloat)height, 1.0, 100.0);gluPerspective( 45.0, (GLfloat)(width)/(GLfloat)((height/2)-1), 1, 150.0f ); gluLookAt(4.0, 5.0, 5.0, 1.0, 0.0,0.0,0.0,1.0,0.0);glMatrixMode(GL_MODELVIEW);glLoadIdentity();//------------------------glViewport (width/2, 1, width/2, (height/2)-1);glMatrixMode(GL_PROJECTION);// Select The Projection MatrixglLoadIdentity();// Reset The Projection Matrix//glFrustum(-1.0,1.0,-1.0,1.0,1.5,100.0);//gluPerspective(60.0f, (GLfloat) width / (GLfloat)height, 1.0, 100.0);gluPerspective( 45.0, (GLfloat)(width)/(GLfloat)((height/2)-1), 1, 150.0f ); gluLookAt(4.0, 5.0, 5.0, 1.0, 0.0,0.0,0.0,1.0,0.0);glMatrixMode(GL_MODELVIEW);glLoadIdentity();}It only shows one viewport.. I don''t know what the hell I am doing wrong.. please help~!!!!!!!! 
  Your mistakes are at the viewport-setup:// FirstglViewport (0, 1, width, (height/2)-1);// SecondglViewport (width/2, 1, width/2, (height/2)-1);If want to set the viewport top/bottom you have to write:// FirstglViewport (0, 1, width, (height/2)-1);// SecondglViewport (0, (height/2)-1, width, (height/2)-1);Or for left/reight:// FirstglViewport (0, 1, width/2, height);// SecondglViewport (width/2, height, width/2, height);With your viewport-setup you made a mixture of both.Maybe I'm wrong but try it!   Corrailcorrail@gmx.atICQ#59184081   [edited by - Corrail on August 1, 2003 10:09:41 AM];  there is a nehe tutorial about multiple viewports, the last one i think....... read it   wherever we ride it''''s metal we bring ;  Thanks for the fast response guys~!! ^_^;Maybe this something got to with thisGLvoid ReSizeGLScene(GLsizei width, GLsizei height) function call....(Can''t tell still.. but I am guessing -_-;  because the last viewport overwrites the previous one.... And yes I saw the Nehe''s tut, but it has the draw function and it sets both viewport in the draw funtion not in the resize function..... only thing I have in the draw function is push/draw object/pop. Very.. ^_^ frustrating.. ^_^ ;  This is because OpenGL cant render two viewports at the same time, so you'd have to do them one by one, automatically meaning you'd have to swap viewports each time you draw the scene, so in the drawing func. Like:void DrawGLScene(void){    SetViewport1();// do stuff vor viewport 1    SetViewport2();   // do stuff vor viewport 2/*Imaginary viewport swapping routines similar to ReSizeGLScene*/}A new viewport setting overwrites the older one.   [edited by - Intamin AG on August 2, 2003 9:35:43 AM];  Thanks a bunch~!!! I will try that~!! Thanks~!!! 