Main Menu

Portal

Started by jtxx000, October 05, 2003, 02:36:59 PM

Previous topic - Next topic

jtxx000

Is there an example of using portals?

EgonOlsen

No, there isn't such an example yet. The basic idea is, that you assign each triangle of the main world (the "level") to a specific sector (by using the appropriate addTriangle()-method) and then build portals between them using the methods in Portals. You then have to enable portal rendering and call build() on this level to create the sector information out of the triangles' sector information.
The problem with all this is, that you have to place the portals by hand and assign the sector numbers on a per-polygon base. You can't simply use 3D-Studio or whatever to create your level.
To fight this problem, i added the XML-format loader to jPCT. This format can handle portal information, but the docs for it suffer. There's some info about it here: http://www.jpct.net/forum/viewtopic.php?t=63 and the DTD can be found in the "doc/manual" directory of jPCT.
One last thing: Even if portals are great for software rendered indoor scenes (because they reduce overdraw so much), i'm favouring octrees nowadays. They are much easier to use and more flexible...but they don't help in reducing overdraw though.
Hope this helps somehow.

jtxx000

Thanks for the fast reply, I think that I'll use octrees because I'm loading the level.