Render non-ortho perspective OpenGL in a clipped rectangle that is ortho perspective?

Hi all,

I want to permit general OpenGL to be rendered within a clipped area. The rest of my GUI however will be orthographic.
Is it possible to mix and match these? Do I merely do a glPushMatrix/glPopMatrix?


It will be very strange to view an obeject drawed in project perspective with objects together in orthographic perspective scene. the front will be shown as a frustum for a box feature.

of cause, push / pop can seperate the vision of them in a scene. why do you od like that? Im afraid except Picasso there would be no artists to draw a scene like that.

Switching between orthographic and perspective projection is normally done via the projection matrix (glMatrixMode(GL_PROJECTION) for the fixed-function pipeline). The model-view matrix shouldn’t include projective transformations (as that breaks the fixed-function lighting calculations).

If you’re dividing the window up into sub-windows, you may want to use glViewport() and possibly glScissor() (the viewport clips geometry, the scissor rectangle clips rasterisation; the difference matters for points, wide lines, bitmaps, clearing, etc).