★ POV-Ray destination for IDL object graphics
posted Sun 5 Oct 2008 by Michael Galloy under IDL, Object graphics, Visualization
I 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 and its related library of classes.
My goals for this destination are two-fold:
- Create better renderings of pure IDL object graphics scenes (with no POV-Ray knowledge necessary).
- Ability to use POV-Ray specific features using custom object graphics classes. These classes render in some way in IDL, but produce effects in POV-Ray that can’t be completely replicated in IDL.
I think the current VISgrPOVRay class supports objective 1 common 3-dimensional object graphics scenes, but lacks support for every property provided by the IDL library. Support for most properties can be easily done as needed.
The second objective requires creating new subclasses of classes in the IDL library with additional properties. For example, there is a VISgrPOVRayLight class which inherits from IDLgrLight class, but also provides support for the POV-Ray area light type. There is a VISgrPOVRayView which provides for features like focal blur in addition to the properties of the IDLgrView. There are also subclasses for grid planes, streamlines, and POV-Ray polygon graphics atoms as well as a finish attribute class. More classes can be added to support additional POV-Ray features as necessary.

The main problem that programmers new to object graphics have is getting anything to appear on the screen (at least anything they recognize). Once you have your graphics appearing in a window, it’s pretty simple to change their properties, rotate them, make them dance the rhumba, etc.
This program is an example of using timer events to do a task in the background while allowing the the user interface to still respond to events. This technique requires the background task to be split into parts which are short enough for each part to complete quickly enough for a user to not notice a delay if he begins to interact with the interface. In other words, if each part of the task takes 0.1 seconds, then there is a potential delay of 0.1 seconds before the user interface will respond.
When rendering object graphics atoms with transparency, the order the atoms are rendered (i.e. the order the atoms are created and added to the hierarchy) determines what can be seen. You want to draw the atoms from back to front when the front items are transparent. The same principle holds true for iTools since they use object graphics.
A couple weeks ago, I wrote a 