The IDLgrX3D object allows you to save the contents of an Object Graphics hierarchy into an X3D format file. The graphics tree can only contain a single view. The resulting X3D file is interactive and allows you to explore the geometry interactively using an X3D browser.
Note: Objects or subclasses of this type can not be saved or restored.
The object is limited to the primitives supported by X3D. Several entities cannot be translated perfectly. These include:
-
IDLgrImage - Rotation and Z buffer behavior are not completely supported. Image objects will be converted into texture mapped polygons. BLEND_FUNCTION is not completely supported (only binary srcAlpha,1-srcAlpha) This function is applied automatically if an alpha channel is present. It is also very browser dependent. Channel masks are not supported. Tiled images are not supported.
-
IDLgrPolygon and IDLgrSurface - Hidden line/hidden point display, color and vertex color blending with texture colors, and bottom color are not supported. Shading may be browser dependent. Front face culling is not supported and back face culling is only supported at the browser’s discretion. The AMBIENT material property is partially supported.
-
IDLgrLight - Lighting scope and intensity may be browser dependent.
-
IDLgrText - The ONGLASS property is only supported for the initial view.
-
IDLgrViewgroup, IDLgrScene, IDLgrVolume - These objects are not supported.
-
IDLgrPalette - Palette objects are simulated using an RGB color model.
-
IDLgrPattern - Only solid or clear patterns are supported.
-
IDLgrFont, IDLgrSymbol - The THICK property is not supported.
-
IDLgrPolyline, IDLgrSymbol, IDLgrSurface, IDLgrPolygon and IDLgrPlot - Line attributes (thickness, linestyle) are not supported.
-
IDLgrView - Z-clipping control, aspect ratio preservation, the LOCATION property, and orthographic projections are not supported.
-
Destination Objects - The COLOR_MODEL property is not fully supported in Indexed Color mode, when using a SHADER_RANGE (an RGB model will be substituted instead). The QUALITY property is not supported.
Example
Construct a 3D model of the dz2 shell for hydrogen, then export to an X3D file:
vertices = ex_spher_harm(polygons = poly)
oPoly = IDLgrPolygon(vertices, polygon=poly, color=[180,50,50])
oModel = IDLgrModel()
oModel.Add, oPoly
oView = IDLgrView()
oView.Add, oModel
obj = IDLgrX3D(filename='hydrogen.x3d')
obj.Draw, oView
obj = 0
Superclasses
IDLitComponent
Properties
Objects of this class have the following properties. In addition, objects of this class inherit the properties of all superclasses of this class.
FILENAME
A string that specifies the name of a file into which the vector data will be saved. The default is idl.x3d.
GRAPHICS_TREE
An object reference of type IDLgrView. If this property is set to a valid object reference, calling the Draw method on the destination object with no arguments will cause the object reference associated with this property to be drawn. If this object is valid and the destination object is destroyed, this object reference will be destroyed as well. By default the GRAPHICS_TREE property is set equal to the null-object.
WORLDTITLE (Init only)
A string containing the text for the X3D title node. The default is 'IDL X3D file'.
Methods
This class has the following methods:
In addition, this class inherits the methods of its superclasses (if any).
IDLgrX3D::Draw
The IDLgrX3D::Draw procedure method draws the given picture to this graphics destination.
Syntax
Obj->[IDLgrX3D::]Draw [, Picture]
Arguments
Picture
The view (an instance of an IDLgrView object) to be drawn. If the view has a LOCATION property, it is ignored.
Tip: Instead of using the Picture argument, it is strongly recommended that you set the GRAPHICS_TREE property and call the ::Draw method without an argument. This allows the IDLgrX3D to automatically clean up the graphics tree when it is destroyed. If you do use the Picture argument, then you are responsible for cleaning up the graphics tree (automatic garbage collection will not work because of the parent/child circular references within the graphics hierarchy).
Keywords
None
IDLgrX3D::GetProperty
The IDLgrX3D::GetProperty procedure method retrieves the value of a property or group of properties for the X3D object.
Syntax
Obj->[IDLgrX3D::]GetProperty[, PROPERTY=variable]
Arguments
None
Keywords
To retrieve the value of a property, specify the property name as a keyword set equal to a named variable that will contain the value of the property.
Any keyword not recognized is passed to this object’s superclass.
IDLgrX3D::SetProperty
The IDLgrX3D::SetProperty procedure method sets the value of a property or group of properties for the X3D world.
Syntax
Obj->[IDLgrX3D::]SetProperty[, PROPERTY=value]
Arguments
None
Keywords
To set the value of a property, specify the property name as a keyword set equal to the appropriate property value.
Version History