Implementing Portals

Posts: 260
Joined: 2005.05
Post: #1
It seems there is no thread specifically on portals, so I thought I could start one.

I am about to add portal support into the 3D code I am writing (a 3D game engine that is presently only for sharpening my 3D skills, OpenGL-based of course). Now I must decide how to do that.

There are many choices to make:

- Exact or approximate frustum. I can make the frustum a set of arbitrary planes, where every edge in a portal adds a new frustum plane, and I merge the frustums. However, I can also make an approximate one, with four axis alined planes. This is easier, and what Akenine-Möller suggests (in the book Real-time Rendering).
- Portals with or without built-in transform. With no transform, the portal always goes to an adjacent room which is modeled in the same coordinate system. With a transform, all rooms may be modeled around origin if I like, and I can make a lot of tricks with rooms entering into itself, like endlessly recursive corridors, mirrors etc.
- Should a portal be done one triangle at a time or at a more complex polygon? Triangles are so convenient to handle, but it seems a bit awkward to render a room several times just because a portal is built from several triangles.

The biggest problem, however, seems to be the modelling. What s a good way to build rooms that I can connect with portals? Maybe I should make some kind of modelling program myself, with which I can attach polygons in one room to some polygons in another, maybe deforming them to fit..?

What do you think? Anyone here who has done portals?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Implementing page views. MacSteve85 2 4,526 Jan 20, 2010 12:09 AM
Last Post: mysteriouspants
  Implementing a formula with quaternions akb825 12 10,880 Oct 16, 2006 09:36 AM
Last Post: akb825