Notes on Rayshade - 5 - Objects

When developing scenes with Rayshade it is usually helpful (both for sanity and speed reasons) to structure the input file; breaking groups of primitives up into objects. It is also important to include copious comments to remind yourself (or another person) what is happening and why!

The basic syntax of an object is:

       [name objname] object-type
                 primitives and/or objects
       end  [transformations] [textures]
Note that the "name objname" part is optional, if this is omitted the object is placed in the scene, if the object is named then it must be instantiated using the object keyword.

In the example below two objects are created, firstly an unnamed object is created using difference and secondly a named object "board". The unnamed object is included in the scene, but 'board' is only included with the 'object board' entries.

        difference
            box  0 0 0   20 20 8
            list
                disc     10   15 0 -1   0 0 -1
                cylinder 10   15 0 -1   15 0 9
                disc     10   15 0 9    0 0 1
            end
        end

        name board
            box 0 0 0  50 10 2

        object board
        object board translate 0 10 0
        object board translate 0 20 0

Rayshade has a number of different object types: list and grid objects are lists of primitives (or other objects) while difference, intersect & union objects are used to do Constructive Solid Geometry (CSG) operations on pairs of objects (or primitives).


Go to next section: List Objects.

Return to Contents.

THE END - Notes on Rayshade - 5 - Objects