I am interested in working alternative to Mathematica's FrontEnd for rendering Graphics3D produced by Mathematica. The requrements are:

  • An ability to import Graphics3D objects exported from Mathematica in any of 3D export formats supported by Mathematica.
  • It seems that in most cases Mathematica's support of 3-rd party 3D geometry formats is incomplete (Mathematica does not export the complete scene description). So the second requirement is that recovering of dropped parts of the scene description would be as easy as possible.

I am most interested in rendering polygonal surfaces computed by Mathematica which are presented internally as GraphicsComplex.

It will be very appreciated if an answerer show the complete way to render some simple Mathematica-generated surface with several point light sources like this:

lightSources = {{"Point", Red, {1/2, 1, 1}}, 
                {"Point", Green, {1, 1/2, 1}}, 
                {"Point", Blue, {0, 0, 1}}};
pl = Show[
  Plot3D[Sin[x*y*Pi^2], {x, 0, 1}, {y, 0, 1}, 
   Lighting -> lightSources], 
    Point[lightSources[[All, 3]], 
     VertexColors -> lightSources[[All, 2]]]}]]



  • 1
    $\begingroup$ I would use Blender. See this question $\endgroup$
    – Jens
    Commented Jan 16, 2013 at 1:05
  • $\begingroup$ @Jens Does Export to the .wrl format also exports light sources specification? $\endgroup$ Commented Jan 16, 2013 at 2:28
  • 1
    $\begingroup$ Not wrl, but x3d format does seem to work. I also tried obj but it doesn't contain the lamps. Unfortunately, in x3d the camera position isn't maintained. My feeling when I did this some time ago was that I could just as well generate the surfaces with Blender's python bindings and not use Mathematica at all for that. $\endgroup$
    – Jens
    Commented Jan 16, 2013 at 4:09
  • $\begingroup$ @Jens Looking in the .x3d file exported from Mathematica (it is an "XML" file) I see only vertex colors for the two objects: IndexedFaceSet and IndexedLineSet. For the former all the colors are white, for the later they are black and it seemingly not necessary at all. Strangely enough, the colors of light sources are shifted by .05: it is '0.9 0.05 0.05' instead of Red for example. $\endgroup$ Commented Jan 16, 2013 at 7:24
  • $\begingroup$ Ah yes, you're right, the material is white - I thought I had deleted some light sources and saw the colors still there, but I actually had only hidden the lamps in the editor, not cut them from the scene... So yes, x3d gets pretty close to a faithful export format. $\endgroup$
    – Jens
    Commented Jan 16, 2013 at 7:34

2 Answers 2


Although exporting x3d format maintains the light sources and exports the mesh, it isn't perfect when used with Blender (the only 3D editor I tried). However, since it's the best solution I have, I wrote some brief instructions for that procedure. It's important to note that I used Blender version 2.60 and Mathematica 9.

Since the instructions are almost entirely related to Blender, they are probably not on topic here, and I'll just point you to the web page where I write the information down together with some screen shots of the interactive interface, because the steps are too hard to explain in words:

Processing Mathematica 3D graphics in Blender

In principle you could export as obj, too, and re-create the light sources in Blender because you might well end up editing them anyway, even with the above approach, since the lighting in Blender will look so different from that in Mathematica.

  • 1
    $\begingroup$ In version 11 at least, X3D does not seem to maintain the light sources. When I tried, it simply inserted the default light sources, even though I set them to something else than the default. $\endgroup$
    – Szabolcs
    Commented Jan 5, 2017 at 19:03
  • $\begingroup$ @Szabolcs You're right, I just checked it again and get the same light sources no matter what I do. I can't be sure now if it ever really worked, since I no longer have the old Mathematica version. I'll leave this answer up since it may still be useful for the other points raised in the question, but light sources are definitely a valid concern that I don't have a solution for... $\endgroup$
    – Jens
    Commented Jan 5, 2017 at 19:38

Here you can find some software to convert Mathematica graphics for input into POVray (untested and rather old, though)


Edit Maeder's book and files aren't available for online downloading (you've to purchase the book)

Edit Or perhaps you can find them at the link provided in the commen


Mathematica can export to pov format, and it works quite well. However, you need to add the light source manually, which is not difficult.

Here is the plot I get using pov-ray

enter image description here

Steps I used:

  1. Export to pov using Export["p1.pov",p1]
  2. Edit the light source. I replaced the original light source to

    light_source{ <0.5, 1, 1> color Red} light_source{<1, 1/2, 1> color Green} light_source{<0, 0 ,1> color Blue}

  3. Remove the default setting for texture

    finish {ambient color rgb 1} pigment {color rgb <1, 1, 1>}

and changed it to

#default {
  texture {
    pigment {rgb 1}
    finish {
      ambient 0.0
      diffuse 0.6
      specular 0.6 roughness 0.001
      reflection { 0.0 1.0 fresnel on }
  • $\begingroup$ When trying to download the files, I get: "The file you requested is not part of the Mathematica Programmer Web Site. It is available only on the Mathematica Programmer CD-ROM that comes with the book." $\endgroup$ Commented Jan 16, 2013 at 1:47
  • $\begingroup$ @AlexeyPopkov It's Maeder's book, of course $\endgroup$ Commented Jan 16, 2013 at 2:17
  • 2
    $\begingroup$ @AlexeyPopkov It seems to be here: http://www.mathconsult.ch/showroom/ray/index.html $\endgroup$
    – Michael E2
    Commented Jan 16, 2013 at 2:18
  • $\begingroup$ @belisarius hope you don't mind the edit. I'm learning rendering using povray and I think it may benefit future reader. $\endgroup$ Commented May 15, 2014 at 23:41
  • $\begingroup$ @xslittlegrass Not at all. In fact my answer was more a bibliographical reference than a hands-on one. It's great to have an actual confirmation that the think works. Thanks! $\endgroup$ Commented May 16, 2014 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.