I think this is not exactly the question asked. Do you want more views? Or do you want to have a 2D background, 3D game objects, 2D gii. If you want this, then:
- make fullscreen background
- set viewport to position = obj.pos-obj.size / 2, size = obj.size, render object
- render 2D gui
Or do you want something else?
EDIT:
Here's a little code:
glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,w,0,h,near,far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(pos.x,...); DrawQuads(); //if you want to keep your previus matrix glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluPerspective(90,width/(float)height,0.001,1000); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glTranslatef(pos.x,...); glRotate(-45.0f,1,0,0); glTranslate(0,0,distance from object); glRotate(90.0f,1,0,0); // or use gluLookAt // 0,0,1 - if you want have z as up in view // 0,1,0 - for y //gluLookAt(pos.x,pos.y,pos.z,cam.x,cam.y,cam.z,0,0,1); glScale(object.width/model.width,...); DrawModel(); // Restore old ortho glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW);
source share