Sign in to follow this  
staticVoid2

sectors from portals

Recommended Posts

staticVoid2    381
hi, my problem is this... I have a triangle soup where the modeller has flagged certain triangles as being portals, I need a way to determine what triangles lie ~inbetween~ those portals, I have been reading previous threads about this (2 in total) on gamedev and seraching google for more info but I can't seem to find any. I heard the best approaches to this is to either use a 3d flood fill algorithm with an AA grid, or to use a bsp tree. It seems more sensible to use a bsp tree so thats the way I'm attempting to do it. if anyone has any links to this subject it would be greatly appreciated, thanx.

Share this post


Link to post
Share on other sites
spek    1240
You could try a floodfill indeed. Check which polygon intersects portal X, then find all the neighbours until you bump on another portal. However, you might risk missing polygons that are not connected in any way (a floating object inside a chamber for example).

If possible, you could also try to flag the sectors as well. For example, I make my levels with Lightwave. First there is the normal textured mesh. In another layer I have an exact copy of that world. In this layer each polygon has a material name that refers to its sector "SECTOR_1, SECTOR_2, SECTOR_..." and cubes with the name "PORTAL". I don't have to search for the sectors now, I just read that layer and the material names. After that I check with which sectors the portals intersect. Later on I can also mannually tell with which sectors each portal intersects, in case you want special effects such as warp-holes or Prey stuff.

Greetings,
Rick

Share this post


Link to post
Share on other sites
staticVoid2    381
thanx for the reply. I found a good web page that explains how to store connectivity information for a leafy bsp, I will use this info for a more accurate flood fill.

I create the bsp tree, then for each node I create a bounding portal, I split this by the planes of the other nodes of the bsp which forms a set of polygon of which I assign a unique ID, then I push each poly down the tree until it reaches a leaf, when it reaches its leaf I clip it to the convex set of poly's in that leaf, I will now have a poly in one sector and a poly in another that shares the same id, this would be the connectivity info I will connect the leafs back together using this info, if a portal is encountered then I will not merge.

I think its something along those lines.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this