- Home /
automatically creating triangles
Hi,
I want to know if there is a way to automatically creating triangles in a mesh.
For example, I set the vertices and do a "magic" command :)
I'm making a applications that the user can draw lines, these lines will be transformed in walls (a closed room) but I'm having the problem to figure How can I make the floor, depending the form the user draws the room, I say, If the form drawed is Convex, it's ok, but if the form is concave, i don't know how to make the vertices links, ensuring the form shape.
You can see the project here:
widemedia.com.br/projetos/homebuilder
Thanks,
Borgo
the very short answer is, no, you have to do it by hand and it's very, very difficult indeed! Bear in $$anonymous$$d that software systems like $$anonymous$$aya -- which exist to do precisely what you describe -- are developed by literally thousands of people. It's a huge mathematical and research and development undertaking.
Answer by Borgo · Sep 07, 2011 at 01:43 AM
I found a script in UnifyCommunity:
http://www.unifycommunity.com/wiki/index.php?title=Triangulator
File not found. EDIT: http://wiki.unity3d.com/index.php/Triangulator
http://www.unifycommunity.com/wiki/index.php?title=Triangulator this link is working now.. just created a floor depending upon the walls
Answer by StephanK · Sep 06, 2011 at 02:07 PM
There is no magic about it. You have to set the vertices first. Then use mesh.triangles to specify which vertices form a triangle.
Ok, So I have a big problem :)
I'm making a applications that the user can draw lines, these lines will be transformed in walls (a closed room) but I'm having the problem to figure How can I make the floor, depending the form the user draws the room, I say, If the form drawed is Convex, it's ok, but if the form is concave, i don't know how to make the vertices links, ensuring the form shape.
You can see the project here:
widemedia.com.br/projetos/homebuilder
So the lines should get transformed into a surface? When do you start this transformation? When he stops drawing or only if he closed the lines?
Not exactly the lines, but the points that the user have clicked. The transformation occurs when the user click on the first point, this ensures that every form drawed will be closed.
So from each closed form you create a surface? Then you could just limit the user to draw the points in the correct order and create the triangles yourself. If you don't want to do that (the limitation) you could still figure out which is the top right topleft and so on.
The points will be drawed in a correct order, the problem is the "concave" forms, I don't want to make a application that make only convex rooms, i want to make a solution to make concave rooms too. I know that it possible, but I dont know how can I make it.
Look at the link I have posted, You can make any room form you want, when you close the form, the program create the walls (regardless if the user drew clockwise or counterclockwise), so I have the vertices points of the surface.
Your answer
Follow this Question
Related Questions
Voxel mesh generation not working. 1 Answer
Setting triangles failing 0 Answers
Connecting flatshaded vertices 0 Answers
Plane mesh generation help 1 Answer