• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Create surface from vertices list

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Zantal

Member
Joined
Mar 19, 2009
I am currently building a "the sims" like house editor in my free time and i am having a simple and stupid problem.

I need to find the surface geometry (triangle list) for a room.

I have a vertices list representing the interesections of the walls that are part of the room, they are not random and if connected together they form the perimeter for that room.

But i really can't find an algorithm that does this, i have been looking for it for about 4 hours this morning and all i have found is for convex geometry (a room isn't necessarily convex)

I remember asking a friend a while back, and he told me the name of the algorithm and now we both don't remember it . . .

I was already thinking about reimplementing it from scratch, but my brain began to smoke after 5 minutes of thinking about it, who doesn't hate geometry in programming?

it's sad I know :p

and i really do hope you can help me out =)
 
You're trying to make/use an algorithm for what seems to be raw input data? Im not understand what you're asking... Discrete math is probably not your solution either.

Can you please specify what you're asking for a little more?

You have x/y/x coordinates of vertices and you need them connected?
 
I display rooms as connected segments. each segment has it's next pointing to the next segment.
a segment Has X Z coordinates, i can run through all the segments until i come to the starting one again (assuming the segments do form a closed circuit)

doing so i can get the vertices list which are the corners of a room. from this list i must create the surface which i would then use to create the mesh for that floor.

for a visual example

https://docs.google.com/drawings/d/1DqjB_OY-y4NGSAMnwsmETbjjMUFmkUWELIS8eUVNLOw/edit?usp=sharing
 
Ok what i am looking for is triangulation.

I didn't know what i was getting into. If anybody knows some good source for implementing triangulation algorithms give me a shout.
 
Back