|
From: Daniel J S. <dan...@ie...> - 2010-12-13 23:51:26
|
Alexandre, It's difficult to visualize what you are doing. For discussion lists it is best to create hunks of code or patches that people can use to test things out. (A patch is created by editing the source code then using the "diff" utility.) Also, if you are thinking that what you have might be a good start for a long term project, placing the patch and discussion in SourceForge helps for organization. Always think in terms of convenience for the audience. Making things easy for half a dozen people helps. The way you would incorporate code is to get the source, modify it and create a patch that can be uploaded to Sourceforge. The patch will then eventually be reviewed and discussed. Anyway, I took the input and output triangles you created and plotted those as follows: USE THE FOLLOWING TO CREATE THE TWO INPUT TRIANGLES YOU MENTION: splot '-' with pm3d, '-' with pm3d -0.5 -0.5 1 0.5 -0.5 -0.5 1 0.5 1.2 1 3 0.5 1.2 -1 3 0.5 e 0.5 0.5 0.9 0.75 0.5 0.5 0.9 0.75 -1.2 -1 3.3 0.75 -1.2 1 3 0.75 e ------- USE THE FOLLOWING TO CREATE THE SIX OUTPUT TRIANGLES YOU MENTION: splot '-' with pm3d, '-' with pm3d, '-' with pm3d, '-' with pm3d, '-' with pm3d, '-' with pm3d 0.013636 -0.046791 1.6043 0.5 0.013636 -0.046791 1.6043 0.5 1.2 -1 3 0.5 0.05122 -0.66212 1.6485 0.5 e -1.2 1 3 0.6 -1.2 1 3 0.6 0.013636 -0.046791 1.6043 0.6 0.05122 -0.66212 1.6485 0.6 e 0.05122 -0.66212 1.6485 0.7 0.05122 -0.66212 1.6485 0.7 -0.5 -0.5 1 0.7 0.013636 -0.046791 1.6043 0.7 e 0.013636 -0.046791 1.6043 0.8 0.013636 -0.046791 1.6043 0.8 1.2 1 3 0.8 1.2 -1 3 0.8 e 0.5 0.5 0.9 0.9 0.5 0.5 0.9 0.9 0.05122 -0.66212 1.6485 0.9 0.013636 -0.046791 1.6043 0.9 e 0.05122 -0.66212 1.6485 1.0 0.05122 -0.66212 1.6485 1.0 -1.2 -1 3.3 1.0 -1.2 1 3 1.0 e -------- There are several things about this. The two input triangles you give don't seem to intersect in their visible portions. That is, I can rotate the plot and find a point where the two triangles don't touch. If the triangles intersect, there should be no angle at which I can rotate the view without the two triangles touching. The second group of triangles don't really seem to match the first two input triangles. I can see one group of three triangles forms one of the triangles of the input. But the second group of three doesn't come close to forming the other input triangle. In fact, the second group of three triangles doesn't form an actual triangle. But upon rotation it does look as though where these polygons intersect is in fact the correct line. So there is something incorrect in what you are doing here. But we need a better means of communicating the concepts you are trying to convey. Try compiling the code and creating some examples. Theory of operation is good too, rather than just code. Dan Alexandre Felipe wrote: > I started writing something here, but i don't know if my input test is good > can someone send-me some triangle pairs to be rendered looking from the > origin > viewing z > 0; -z<x<z; -z<y<z > > There is a result attached in this e-mail (i hope it can be delivered), i > put two problematic triangle (who are called this triangles), after the > program separate it in six triangles, wich must render exactly de same > points but with the diference that, for these triangles there are no more > changes in the visibility, if one point of a triangle is in the front of the > other, all points of this triangle will be in the front of any point in the > other. > The idea is, since the change of the visibility happens in the > intersections, i only constructed a new set of triangles wich don't > intersect in a distance greater than 0.01% of an edge. > > I think it's convenient test it, and then start translating it to C, then i > send it for you, does someone know a software for this? > > now it is 192+181+160 lines length > > > > ------------------------------------------------------------------------ > > input: > -0.5 -0.5 1 > 1.2 1 3 > 1.2 -1 3 > 0.5 0.5 0.9 > -1.2 -1 3.3 > -1.2 1 3 > e > output: > 0.013636 -0.046791 1.6043 > 1.2 -1 3 > 0.05122 -0.66212 1.6485 > > -1.2 1 3 > 0.013636 -0.046791 1.6043 > 0.05122 -0.66212 1.6485 > > 0.05122 -0.66212 1.6485 > -0.5 -0.5 1 > 0.013636 -0.046791 1.6043 > > 0.013636 -0.046791 1.6043 > 1.2 1 3 > 1.2 -1 3 > > 0.5 0.5 0.9 > 0.05122 -0.66212 1.6485 > 0.013636 -0.046791 1.6043 > > 0.05122 -0.66212 1.6485 > -1.2 -1 3.3 > -1.2 1 3 > e > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > > > ------------------------------------------------------------------------ > > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |