Martin,

Using depthorder is creative.  I'd like to point out that depthorder is only an 
approximation to what should be "hidden surfaces".  I worked on many aspects of 
gnuplot.  Although gnuplot does have a hidden line algorithm (i.e., it can 
break a mesh into line segments--based on intersections of lines--and discard 
those segments which are hidden by a surface), it doesn't have an algorithm 
that breaks surfaces into triangles--based on intersections of surfaces--and 
discard hidden surfaces.  So depthorder is an approximation that quite often 
has patch that seems out of place, sticking through a surface it shouldn't, etc.

I've always felt motivated to write a hidden surface algorithm but hadn't found 
the time given how much work that would require.  Even the syntax "depthorder" 
would be nice to deprecate, and instead simply refer to it as "hidden".

It sounds like David Bateman has a lot of knowledge about 3D visualization.  
Perhaps a long term project could be started for gnuplot, but it would be a 
while before I could work on such a project.

Dan


> ## workaround for visualization with gnuplot
> tmp = tmpnam();
> [fid, msg] = fopen(tmp, "w");
> if ( fid == -1 )
>   error("Could not create temporary data file\n%s", msg);
> endif
> for ii = 1:size(T, 1)
>   fprintf(fid, "%f %f %f %f\n", p(T(ii,1), 1), p(T(ii,1), 2), p(T(ii,1), 3), 
> c(T(ii,1)));
>   fprintf(fid, "%f %f %f %f\n\n", p(T(ii,2), 1), p(T(ii,2), 2), p(T(ii,2), 
> 3), c(T(ii,2)));
>   fprintf(fid, "%f %f %f %f\n", p(T(ii,3), 1), p(T(ii,3), 2), p(T(ii,3), 3), 
> c(T(ii,3)));
>   fprintf(fid, "%f %f %f %f\n\n\n", p(T(ii,3), 1), p(T(ii,3), 2), p(T(ii,3), 
> 3), c(T(ii,3)));
> endfor
> fclose(fid);
> cmd = sprintf("gnuplot -p -e \"set pm3d;set style data pm3d;set pm3d 
> depthorder;splot '%s' using 1:2:3:4\"", tmp);
> system(cmd, 0, "async");

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to