• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Multiple Viewports/Perspectives

## 4 posts in this topic

How can you make Multiple Viewports/Perspectives?? Like a square in the top left of your screen that shows the view through someone in your squad''s eyer etc.? Ive seen this done in a few D3D games, but I dont remember seeing it in openGL, is there a way to do this, is it very complicated? thx in advance
0

##### Share on other sites
To do something like that, you''d need to render two scenes, your view and the buddy-cam view, render the buddy cam in a samll off-screen buffer and blit onto the primary buffer.

If you wanted a rear-view, you might be able to use environment mapping...

Magmai Kai Holmlor
- Not For Rent
0

##### Share on other sites
Ive done this before, one of the ways to do this is to render the everything you need from the 2nd cameras POV to a texture, then render the texture to a quad. The only problem with this is the speed factor. This will probably slow down your framerate considerably so you will want to implement a lower LOD for the 2nd POV because it will probably be rendered to a smaller portion of the screen.
0

##### Share on other sites
I think the simplest way is something like this:

glViewport(yadda yadda);// set projection matrix// Draw first sceneglViewport(yadda yadda);// set projection matrix// Draw second scene

I''m not sure if you can have the viewports overlapping though.
0

##### Share on other sites
I''m sure the viewport thing would work. I was going to suggest that too. If there are any problems, just mask out the rest of the scene when doing the 2nd camera.
0