The #include (cpp) directive, has two options:
#include "filename" #include <filename>The "filename" option is useful when including a file from the current directory (though absolute paths are allowed).
A library of rayshade objects can be created quite simply using the <filename> option! When this form is used the filename is only searched for in the standard include directories. What this actually means may vary between implementations, but, I would expect most implementations of cpp to allow the -Y parameter.... The script file I use to run Rayshade includes the following:
rayshade FILE.ray -P '-Y/staff/raylib -DIMAGES=/staff/RLE' -O FILE.rle 2> FILE.msg where FILE is the name of the rayshade description file; and /staff/raylib is the location of the "library" files.The -P instructs Rayshade to pass the text in quotes as parameters to cpp. The -Ypath instructs cpp to include path in it's list of standard include directories.
The -D parameter is explained in the next section (Creating an Image Library).
Each object in the library is contained in two files, one with the surface definitions and the other with the object definition. The library object files should not specify eye or look points, or in fact, anything except the object definition.
Where the object is a light fitting then a comment is included specifying the appropriate location for a light source...
The objects are (normally) located at or near (0,0,0) to make them easier to locate.
In addition to the two files mentioned above, it is normal to produce a drawing showing various views of the object (with dimensions) and written notes as appropriate. The drawings and notes together with a print of the object is then posted on a wall in the Computer Graphics Lab!
To use the library, students simply look across the wall (to find the object they want) then reference the object in their files, for example:
#include <chair_chesterman.surfaces> #include <chair_chesterman.ray> object chair_chesterman translate 5000 6000 0The only hiccup that often ocurrs, is when the student is using Metres and the object uses Millimetres (or visa versa). Of course, there are some objects using other units of measurement (just to make things interesting....).
Return to Contents.
THE END - Notes on Rayshade - Rayshade Tips and Tricks - Object Library