Orthogonal and perspective projection at the same time.

I want to draw in multiple views.
In the above picture, View1 is Orthogonal projection view and View2 which contains a cube should be perspective and View3 which contains the label on the cornor of the cube should be orthogonal.

How can I make these three views in one view togather?
And is it possible ?
I am waiting for Any experience and advice for application structure or
API or any sample code.

You can change the projection matrix whenever you want and it will simply apply to all following glDraw* calls. Your views 1 and 3 are probably supposed to be on top of view 2 so I’d suggest rendering view 2 first. Do you need view 1 or view3 to be depth sorted?

Your render loop should probably be structured like this:


glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustumf(...);
glMatrixMode(GL_MODELVIEW);
// draw objects in view 2 here

glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(...);
glMatrixMode(GL_MODELVIEW);
// draw objects in view 1 here

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(...);
glMatrixMode(GL_MODELVIEW);
// draw objects in view 3 here