|
From: Alexandre F. <o.a...@gm...> - 2010-12-12 15:52:05
|
"I had reached the conclusion that implementing the rendering by determining intersections of surfaces pretty much as defined might be the best place to put effort." - Daniel J Sebald Find all the triangle pairs for wich the nearest vertex of firstis nearer than the farthest of the vertexes of the second triangle, and the farthest vertex of first is farther than the nearest of the vertexes of the second triangle. these are the ones who may need to be splited. then take the planes containing the two triangles, intersect them, it can result an line (say Li), or a null intersection, in case of being a line, find all the intersections of Li with the triangles edges. it must be in the following sequence enter triangle 1, exit triangle 1 enter triangle 2, exit triangle 2 in all other cases, the triangles are splited in the line Li After proceeding in this way you can use any criteria to sort the triangles, i think this is the minimal algorithm, it takes about 1 days to be coded ant two or three to get working :D I have a C++ 3D geometry class. but it uses overloaded operators (everywhere), with this class I am able to implement, i think, what i described above. if one want to translate the C++ to C and compile it i can spend some time for writing it, and send yet this week. |