Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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], 
  Graphics3D[{PointSize[Large], 
    Point[lightSources[[All, 3]], 
     VertexColors -> lightSources[[All, 2]]]}]]

plot

share|improve this question
1  
I would use Blender. See this question –  Jens Jan 16 '13 at 1:05
    
@Jens Does Export to the .wrl format also exports light sources specification? –  Alexey Popkov Jan 16 '13 at 2:28
1  
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. –  Jens Jan 16 '13 at 4:09
    
@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. –  Alexey Popkov Jan 16 '13 at 7:24
    
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. –  Jens Jan 16 '13 at 7:34
show 2 more comments

2 Answers

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.

share|improve this answer
add comment

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

http://www.mathconsult.ch/showroom/pubs/MathProg/htmls/2-11.htm

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 comments

share|improve this answer
    
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." –  Alexey Popkov Jan 16 '13 at 1:47
    
@AlexeyPopkov It's Maeder's book, of course –  belisarius Jan 16 '13 at 2:17
1  
@AlexeyPopkov It seems to be here: http://www.mathconsult.ch/showroom/ray/index.html –  Michael E2 Jan 16 '13 at 2:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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