Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


tuning a bunch of points to a bunch of triangles

This topic is 5324 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

basically i had bunch of faces which formed a convex object and i did intersection tests with these faces to get the points where they join not i want to make triangles from these points and make sure that all tiangles dont overlap and all normals from the triangles are pointing outwards, im having trouble trying to figure this one out any help would be gratefull. thanks

Share this post

Link to post
Share on other sites
At the bottom of this page is a paper about Surface reconstruction from unorganized points, which sounds like what you may be looking for. Be warned, it's not really a trivial problem.

I don't know if that's really what you're looking for, but I hope it helps.

Blender--The Gimp--Python--Lua--SDL

[edited by - VertexNormal on March 24, 2004 2:11:13 AM]

Share this post

Link to post
Share on other sites
thanks for the reply, im sorry but i should of written what exacly what i was trying to do im trying to turn a convex brush made from faces/planes into a set of usable triangle i dont know if im going about it the correct way.


Share this post

Link to post
Share on other sites
Ive done this just a few weeks ago.

If youve already gotten the points from the intersecing planes, your off to a good start. Did you keep the points that came from separate planes separate? For example, if you were working on a cube (6 sided) brush, then you should have extracted 4*6 = 24 points (although some of these will be the same).

So take your 4 points which make up one of the cube''s side. Here is how you can sort out the vertices to make sure that they are not just in ''random'' order:

Pick any 2 verts, a ''head'' and a ''tail'' and create a vector out of them.
while num verts in sorted list is less than num verts to sort
For each vert except for the tail, create
another vector out of the tail and this new vert.
find the angle between the two vectors created, keeping track of biggest angle
the new vector that caused the biggest angle is definetly an edge. (its two verts)
let the HEAD be the next vert in the sorted list.
reverse the vector''s direction
if resulting polygon normal is opposite sign as plane normal
reverse order of vertices in polygon

Once youve got the vertices for the polygons sorted out, then you can go about splitting them into triangles. This is pretty simple. You pick any vertex, and then cycle around the outside of the polygon, 2 (more) vertices at a time. Every 3 vertices makes a triangle.

Share this post

Link to post
Share on other sites

  • 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!