On Wed, 10 Sep 2003 22:39:18 -0500
Matthias Weber <matweber@indiana.edu> wrote:
> I am writing to find out whether other people around here are interested
> in a major 3D graphics project.
Yes, I am.
>
> My (personal) goal is to port a pretty large library of minimal surface
> parameterizations away from Mathematica to another math software
> package, and Maxima has become choice #1.
>
> The current support of 3D graphics in Maxima is somewhat limited (as
> far as I can see) in that only simple 3d plots of parameterized
> rectangles are supported.
>
> It would for instance be nice if one could combine various 3d plots and
> add other primitives like text etc. (can one access and manipulate the
> result of a plot from within Maxima, btw?).
In the Free Software Meeting at Metz, I talked with James Amundson
and Ayal Pinkus (Yacas) about writing a common 3D data plotter for both
(and hopefully other) programs.
I have now a simple OpenGL plotter that takes the files produced
by Maxima when rendering to Gnuplot (maxout.gnuplot) and displays them.
It can indeed combine plots (called "datasets"), and I plan to
add text soon. I've already found GPL libraries for font handling and
PostScript output, so I don't expect to have problems in providing that.
We have now Joris van der Hoeven (Texmacs) invited here in
Saarbrücken (http://www.ags.uni-sb.de) and we have been talking about
how to put this plotter into TeXmacs so that it would ask the CAS to
compute the sample points, and then display the plot inline, but it
would be perhaps not until next week when we look at it as now we are
concentrating in XML input/output for TeXmacs.
> I have, however, something different in mind. My current Mathematica
> set-up uses PoVRay (this is an open source raytacer) as an external
> viewer.
>
> For a parameterized surface, I create triangle meshes for the surface,
> thin cylindrical pieces for the parameter lines, and little spheres
> for the intersection points where the parameter lines intersect.
> These data are written to a file, which is rendered by PoVRay, and
> then imported back into Mathematica.
> This whole process is surprisingly fast, and unless one insists on
> production quality perfectly anti-aliased images, the bottleneck lies
> clearly at the file operations.
>
> All this functionality can (and will be) easily reproduced from within
> Maxima.
Nice. I wanted to export eventually the plot to Povray in the way
you describe (computing these primitives in the plotter), but it's not going
to happen anytime soon.
> So here is (finally) my question: What about building a raytracer into
> Maxima?
There is a program called Surf which uses this approach (although
with raycasting instead of raytracing), with very nice results:
http://surf.sourceforge.net/
It doesn't convert the surface into a polygon mesh, but computes
the ray intersections at each pixel, so you don't have to worry about
picking the sample points.
I have no idea how efficient would it be to do this within Maxima.
> One could set up special data structures for 3D objects which can be
> generated (even symbolically, say for animations), and then call a
> function 'render' that would
> raytrace an image of the objects in the scene. The mentioned bottleneck
> would disappear, and one could have the highest quality rendering engine
> ever built into Maxima.
Well, if you use the options "-I - -O -", Povray will take the
scene description from stdin and put the rendered image into stdout,
so you would just have to execute it from Maxima and then send the
result image to whatever interface you use for display.
This would eliminate the disk activity.
Kind regards,
--
Alberto González Palomo
Toledo, España / Saarbrücken, Deutchsland
Alberto.Gonzalez@matracas.org