# Creating sectors from meshes and portals

## Recommended Posts

Enrico    316
Hi, I am currently trying to display Doom3 and Quake4 maps. The appropriate map compiler gives me the following: - A list of meshes with triangles - Portals with positions and sector indices As you can see, there is no mapping between the meshes and the sectors. There are only sector indices. My problem is now to generate the sectors from the meshes, to use with Portal Culling. My current algorithm:
For all sector ids do:
Collect all portals with this id
For all (remaining) meshes do:
If this mesh is between the portals:

This has some problems, where meshes are added to more than one sector if not needed to. But at least it is better than doing Frustum Culling for every single mesh... Any other ideas or things I could try? Maybe I have overlooked something? Thanks, Enrico

##### Share on other sites
PfhorSlayer    316
The meshes that are to be used to draw the sectors are named something_XXX (I don't remember the name specifically), but they're all numbered in that way.

##### Share on other sites
Enrico    316
Quote:
 Original post by PfhorSlayerThe meshes that are to be used to draw the sectors are named something_XXX (I don't remember the name specifically), but they're all numbered in that way.

Hey, this seems to look right :-) :-) Thanks, I just tried to compare the numbers at the end of the names with the sector indices and it seems to work. I will make the mapping later :-)
Thanks :-)