|
From: Stanislav M. <sta...@gm...> - 2010-12-10 11:39:55
|
On Thu, 2010-12-09 at 12:11 -0800, Ethan Merritt wrote: > On Thursday, December 09, 2010 07:53:12 am Stanislav Maslovski wrote: > > > Replying to myself: actually, after reading some docs (and the code) I > > > realized that it was a limitation of the rendering algorithm used by the > > > gnuplot (a variant of painter's algorithm). So, I solved this issue by > > > patching pm3d.c:pm3d_depth_queue_flush() so that sorting of quadrangles > > > was done based on the average depth of 4 corners. > > I don't think this is the best way to approach the problem. > As Hans-Bernhard pointed out, _any_ simple-minded sorting on a > single Z value is going to fail for some configuration of triangles. > The bigger the triangle, the more likely that any single Z value is not > right for the whole thing. BTW, just a little clarification in case if someone reading this has not looked into the patch: the patch does more than just averaging the depth of 4 corners, instead, it introduces a new pm3d option "corners2depth" that allows for configurability of the depth sorting in a similar manner as already existing "corners2color" option adds configurability to the coloring. -- Stanislav |