09-27-2005, 05:27 AM
I am working on a project with OpenGL and I want to show a 2D side of a 3D object in the top right corner (1/4) of the screen. I am sure I need to use glViewport, but it doesn't seem to work properly. Right now I have a cube that rotates at 7 degrees about all 3 axes each time the left mouse button is clicked. I have this occuring at the center of the screen with width w and height h. So right now I call glViewport( 0, 0, (GLsizei) w, (GLsizei) h); I thought I should be able to just call glViewport( (GLsizei) (w/2), (GLsizei) (h/2), (GLsizei) w, (GLsizei) h ); to put the object in the top right corner. But this doesn't work as I expected it to. Does anyone have an idea why it will not display properly in the top-right corner. The cube seems to be in the top-right corner of the top-right corner...not the middle of the top-right corner. Thanks for your help!