Vegetation Object Placement
Include File
for the Persistence Of Vision SuperPatch v3.1e |
Created by Mark Wagner, 21 June 1999
Updated 10 July 1999
Updated 17 July 1999
Updated 14 September 1999
Copyright and Legal Information
INSTALLATION |
C:\Program Files\POV-Ray for Windows\Include
On UNIX and similar systems,
where filenames are case-sensitive, you may have to rename the include
file so that all letters are lowercase. This will enable you to render
the sample files without modification.
QUICK START |
The Object Placement include file allows you to randomly place user-defined objects on the surface of another object with random rotation around the sky vector. This is mainly useful for placing vegetation on a heightfield, but can be used for many other things (craters on a planet, bugs on a windshield, etc.) You can specify the objects to use, the maximum and minimum altitudes for placement, and many other options.
Using the Object Placement include file is as simple as declaring the object to place items on and including the file, eg:
#declare
VegeObject = sphere{ <0,0,0>, 15 pigment{ rgb <0,1,0> } }
#include
"vegetate.inc"
This will create 100 pine trees (the default object) scattered on the upper surface of an invisible sphere. As the include file does not automatically add the object the items are being placed on to the scene, you will need to include a line such as:
object{ VegeObject }
somewhere else in your scene.
There are options which control how the objects will be placed; to use any of these you simply add the following line to your POV-Ray scene file:
#declare [variable-name] = [value]
substituting the desired variable name and value where appropriate. After you have declared all the options you want to use, you add the following line to your POV-Ray scene file:
#include "Vegetate.inc"
The Object Placement include file will then automatically place the objects for you. Although only one option is required to place objects (VegeObject), you will want to use the options listed below to ensure you get the result that you want.
Note that Vegetate.inc
should never be included at the start of a scene (like colors.inc
or textures.inc). It should only be included after first declaring
the desired options.
Basic Options |
VegeObject
#declare VegeObject = object{MyHeightField scale .007}
#declare VegeObject = cylinder{ y*3, y*17, 2.71828 pigment{ rgb<3,.14,15>
}}
Note: the Object Placement
include file will not place a copy of this object in your scene.
Any POV-Ray object can be
used, including CSG objects and triangle meshes.
Declaring this parameter
is required.
VegeNumber
#declare VegeNumber = 299792458; //Note: this will take almost forever to generate
VegeMinBox and VegeMaxBox
Sky Vector | Order of Coordinates |
y (normal) | <x,z> |
x | <y,z> |
z | <x,y> |
Example:
#declare VegeMinBox = <2,17>;
#declare VegeMaxBox = <3+clock*4,18>; //The box increases as time
passes.
VegeList
#declare VegeList = array[3] //3 different objects to choose from
#declare VegeList[0] = object{DeadFly}
#declare VegeList[1] = object{BirdSplat}
#declare VegeList[2] = cylinder{y*1,y*7,8.31 texture{Sky03}}
The default object is a very simple pine tree one unit high.
Note: the objects in this list should have their bases at the origin in order for random rotation and scaling to work.
VegeRotate
#declare VegeRotate = off;
VegeAlign
#declare VegeAlign = on;
VegeWaterLevel
#declare VegeWaterLevel = 4.0026;
VegeTimberLine
#declare VegeTimberLine = 1840;
Note: If the value specified for VegeTimberLine is less than the value of VegeWaterLevel, an error will occur because you have eliminated all possible locations to place objects.
VegeMaxSlope
#declare VegeMaxSlope = 90; //Only exclude vertical walls
VegeMaxScale and VegeMinScale
#declare VegeMaxScale = 3;
//Objects will not be made more than 3 times their original size
#declare VegeMinScale =
.5; //or less than half their original size
Advanced Options |
VegeHeight
VegeSeed
VegePosGauss
VegeTypesGauss
SkyVector
#declare SkyVector = -x; //Ok
#declare SkyVector = z; //Useful for scenes created in Moray
#declare SkyVector = <1,.32,7.6>; //Won't work
VegeCollide
#declare VegeCollide = on; //or true, or yes
The default is off.
Note: The time taken for collision detection increases as the square of the number of objects, meaning that doubling the number of objects will more than quadruple the time needed to place the objects. Also, it is possible that when placing a large number of objects in a small area, Vegetate will be unable to place all the objects and will get stuck in an infinite loop, so use collision detection with care. Also, to save time, the collision detection routine does not take random scaling of the objects into account.
VegeRadius
#declare VegeRadius = 6.02e23;
VegeExcludeHeight
#declare VegeExcludeHeight = array[1]
#declare VegeExcludeHeight[0] = 7;
VegeExcludeCircle
#declare VegeExcludeCircle = array[1][2] //Replace 1 with the number
of circles in the array
#declare VegeExcludeCircle[0][0] = <5,5>; //Region is centered at
5,5
#declare VegeExcludeCircle[0][1] = <2,2>; //Radius is 2.
VegeExcludeBox
#declare VegeExcludeBox = array[1]
#declare VegeExcludeBox[0][1] = <5,5>;
#declare VegeExcludeBox[0][0] = <7,3>; //The order in which the
corners are specified does not matter
Verbose
#declare Verbose = 8.314510; //Any value at all will do, even zero
COPYRIGHT AND LEGAL INFORMATION |
The Vegetation Object Placement Include File may be bundled with or without other software on CD-ROM collections, Bulletin Board systems and other file archives, providing that all associated files, including documentation and samples, are included. I would also request that persons intending to distribute the Vegetation Object Placement Include File in this manner or otherwise would first contact me to ensure that they are in possession of the latest available version.
Further, no restrictions
of any sort are placed on the usage of the include file itself (Vegetate.inc),
and scene files or images created using the include file remain entirely
the property of the user or users who have created them. I claim no liability
or responsibility for damages or loss resulting from usage of the include
file, or any part of the include file package.
CONTACTING THE AUTHOR |