www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: jtxx000 on October 05, 2003, 02:36:59 pm

Title: Portal
Post by: jtxx000 on October 05, 2003, 02:36:59 pm
Is there an example of using portals?
Title: Portal
Post by: EgonOlsen on October 05, 2003, 04:43:44 pm
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.
Title: Portal
Post by: jtxx000 on October 05, 2003, 11:06:54 pm
Thanks for the fast reply, I think that I'll use octrees because I'm loading the level.