Why are Include Files so helpful
and what can we do with them?
The scenery description language (SDL) of POV-Ray has a very strong and useful structure
of the include files, well-known from all programming languages.
Include files are an elementary tool of modular programming!
The include file mechanism is a method
to avoid unneccessary work and speeding up the developping of POV-Ray scenes.
This "Short Include File Tutorial" shows how it works and gives some basic hints on
what to do and what to avoid.
It's a result of my own practice in using this feature,
my own experience with include files
[which includes also many
great successes :-) as well as many great defeats and disasters :-(.]
What is an Include File?
Include files (extension: .inc) are simple ASCII text files,
which can contain any type of text parts for POV-Ray (in a correct POV-Ray syntax!).
They can be inserted anywhere (where it makes sense!) in a POV-Ray scenery text file (extension: .pov ).
Original POV-Ray Help:
"The include file is read in as if it were inserted at that point in the file.
Using include is almost the same as cutting and pasting the entire contents of this file into your scene."
What can we put in an Include File?
Nearly every part of ASCII text, provided that it makes any sense in POV-Ray.
Every thing which we want to use more than one time and which we don't want to rebuild from new.
(objects, colors, textures, materials, functions, declarations of useful abbrevations, etc.)
Elements and parts of bigger projects, to keep complex structures easier to handle.
Can we use other include files in an include file?
Yes, we can! Complex objects often need other include files for their elements!
Also recursive self-calling include files are possible!
|