Archived

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

Gazza

Anti Penumbra Questions

Recommended Posts

Hi, Im on the last leg of implementing a PVS set for my BSP engine. I have the Portal generator workig fine and now its time for me to cast my ant penumbra out from each portal etc etc etc. It works by taking each VERTEX in the source portal and creating planes with each EDGE of the destination portal and and seeing what other portals fall within these planes and then recursing onto that leafs portals etc. ANYWAY, I have a slight problem.The planes are generated by taking two edges :- SrcPortalPoint-DestPortalPoint1 SrcPortalPOint-DestPortalPoint2 And then performing the cross product on them to get the Plane normal. This works fine but in the following case. Lets say that i have two portals that are at right angles to each other with two of their edges touching to make a kind of L shape. Where one of the Portal1 points is on Portal2 plane it is impossible for me to make a plane because i do not have two valid edge vector to perform the cross product with.So there fore i can not get the Plane normal. any ideas what i can do about this

Share this post


Link to post
Share on other sites
I think I´m the only one that answers your question.
OK, here we go:

Before you create the plane, check if it´s possible then do the normal antipenumbra calculation and carve something off, else, if it´s not possible, try it with the other points(even in your L case you can carve sth. off), then go to the next portal and do the same thing again.

I hope I could help.
--Matt--

Share this post


Link to post
Share on other sites
Hi matt

Thanx for you reply.

Im thinking now that the eaiest option may be to test if any of the Souurce portals Points are ON the plane of the Dest portal and if they are then NUDGE them a fraction of a distance towards the center of the source Portal Polygon.Seems to work fine atm .

regards

Share this post


Link to post
Share on other sites