★ IDL object graphics to POV-Ray
posted Mon 10 Mar 2008 by Michael Galloy under IDL, Object graphicsPOV-Ray is an open-source 3D ray-tracing tool (check out the Hall of Fame for examples of its use). After listening to Peter Messmer’s excellent introduction to POV-Ray scene creation and seeing VisIt’s export to POV-Ray capability, I thought it wouldn’t be that hard to make an object graphics destination. To use it, create the scene as usual and then have the POV-Ray destination send its output to files for input into POV-Ray (the same as using IDLgrWindow
).
The image shown is a direct export of a simple object graphics scene with an IDLgrPolygon
(cow10.sav
) with VERT_COLORS
and SHADING=1
, a directional light source, and a green IDLgrPolygon
. Right now the POV-Ray destination supports ambient and directional lights, polygons, and surfaces. Only a few properties for polygons are supported: vertex colors, shading, and color. I’ll add more property and atom support as needed. The only problem right now is that POV-Ray uses a left-handed coordinate system, so I’m trying to think of the most elegant way to turn things around so that its scene matches the IDL scene.
I’m not sure what I’m going to do with the source code right now. I’ve added it to a “visualization library” that I’ve been using. Let me know if you are interested in trying it out.
UPDATE: it’s not hard to turn the POV-Ray output into a movie.
March 10th, 2008 at 1:42 pm
I love this stuff.
Kelly Dean
Fort Collins, CO
March 10th, 2008 at 7:56 pm
I guess I’m not sure what exactly you mean by “POV-Ray destination”. Do you create a POV-Ray device and output to that? Can you “shed some more light” on this? Thanks.
March 10th, 2008 at 8:03 pm
I have a destination class VISgrPOVRay (like IDLgrWindow or IDLgrBuffer) that has a draw method. So it would something like:
IDL> pov = obj_new('VISgrPOVRay', file_prefix='output')
IDL> pov->draw, oview
This will produce a file output.ini (and a bunch of others) that can be run through POV-Ray.
March 10th, 2008 at 11:17 pm
It’s greate. I am looking for the methods which IDL can export graphic object to other 3D files, such as pov-ray, blender, 3Dmax, VTK and so on. Can I try it?
March 11th, 2008 at 9:18 am
Cool. I’d like to give a try. Thanks.
May 16th, 2008 at 2:45 am
Hello,
I am using currently using a bunch of 3D softwares to get my 3D objects processed and finally converted to a POV scene (With IDL as glue between all those elements). Having the possibility of directly exporting the scene from IDLgrWindow to a PoV file would make my life simpler. I would be very grateful to get a copy of your source (strictly for academic usage).
With my warmest regards and thanks,
Thomas
October 6th, 2008 at 12:03 am
[…] spent some time improving the POV-Ray destination for object graphics I talked about in a previous article. I can now produce visualizations of actual data (like the one on the right) using this destination […]
February 20th, 2009 at 12:46 pm
[…] for polygons and a VISgrPOVRayWindow class to the POVRay destination class for object graphics that I’ve mentioned before. The image to the left uses texture maps on an IDLgrPolgyon. It has a single […]
August 28th, 2009 at 10:55 am
[…] file and API documentation for the POV-Ray object graphics destination that I’ve mentioned before are available here 1 Comment […]
November 17th, 2009 at 3:46 am
My query id the following:
When i am drawing spheres in idl using mkpov;i m getting the following error:
IDL> $x-povray +Iimg01.pov +D 2>err
It does not opens any window for the image….Is it because i need to run it where my povray is installed??
November 17th, 2009 at 5:35 pm
What is the contents of the err file?
Also, try running your POV-Ray command on the .ini file generated by the VISgrPOVRay destination.
The POV-Ray executable needs to be in your system path. Can you execute this line from outside of IDL?