Troubles with Portals...

andrewvtran 101 Feb 11, 2003 at 02:04


I am trying to implement a 3D portal engine using the algorithm presented in the book “Real-Time Rendering” pg. 201, but I am having troubles with the following thasks:

First of all, as my portals are of diferent shapes, not just rectangulars, I simplify it to a simple AABB, but here comes my troubles.

Could someone tell me how can I project my portal AABB from world space to screen space?, and how can I build a frustum from a AABB?

I really appreciate any help about this.

1 Reply

Please log in or register to post a reply.

PixelDuck 101 Feb 11, 2003 at 18:34

I would recommend not to use a box, just a rectangle placed in the “middle” of the AABB. You could then use the edge vertices of the quad to build a caped pyramid from these vertices (the new view frustum). Just compute the plane of the view point and each adjacent quad vertex and use this for the next oclusion test. Of course you might want to do something like test if the plane area of the quad restricted by the quad vertices intersects the previous frustum in the recursion to determen if the portal is even visible, so that you won’t process too many portals.

Btw. I haven’t made a portal engine yet, so this is just a pure hypothesis, but I hope that might help (or actually work) :rolleyes: