Jump to content
  • Advertisement
Sign in to follow this  
staticVoid2

sectors from portals

This topic is 3556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!