There are (actually) 3 parts in a CDV file:

  1. header: This part describes only the 3D axis used and is only provided for convenience purpose. It enables users to choose standard axis (like L*a*b* color space; xyY ...) or custom axis.
  2. displaylist: OpenGL can optimize 3D rendering using display list. This mechanism allows user to compile complex 3D rendering as a single display list which can be executed in the script.
  3. script: This part contains all the 3D data which will be displayed.

Example

# this is a comment
begin header
axis RGB    # this script display data in the RGB color space
axiscolor x 1 1 1 # the R axis is white (not red anymore)
backgroundcolor 0 0 0 1 # black background
end header
begin displaylist
newlist myfirstlist # I create a new list named myfirstlist
color3f 1 0 0       # the current color is red
volume box          # display a 3D box (size 1)
endlist             # terminate the display list
end displaylist
begin script
pointsize 3         # the current point size is now 3
color3f 1 0 0       # the current color is red
begin points        # all the data provided to the graphic pipeline
                    # will be used to display points
vertex3f .5 .5 .5   # display a point at the (0.5,0.5,0.5) position
vertex3f 1 .3 .4    # display a point at the (1,.3,.4) position
end points          # no more points to visualize

pushmatrix           # we stack the current coordinate system
translatef 1 1 1     # we translate the new coordinate system
scale .3 .5 .1       # we scale the new coordinate system
calllist myfirstlist # display the red box in the new coordinate system
                     # the center of the displayed box is (1,1,1)

popmatrix            # return to the original coordinate system
end script

HomePage

PHP Warnings

lib/pear/DB/common.php:741: Notice[8]: Only variable references should be returned by reference