One problem is that there is very little entry-level instruction, and by very little I mean none. I thought the best way to learn the basics was to try to write a few simple instructive scripts, so here goes.
The image above was created using the following script, which can be pasted right into the program, where it will appear in colors that make it a lot easier to understand. I have added explanatory notes:
// a two component script
8 * { x 1.5 ry 45 hue -20 } // builds a series of boxes and
// changes their color
6 * { x 1 s 1.1 ry -35 hue 10 } box // applies this to each of
// the boxes, changing size and color.
// Red is the default color and the hue modification number
// is degrees on the color wheel.
// Locations are defined by coordinates - x (l-r), y (u-d), z (f-b)
// ry means rotate along the y axis. ditto for rx and rz
// Putting a size change into the brackets makes it recursive,
// each box that much smaller.
// to make it uniform, add it as a prefix, as 1 * ( s 0.9 } at the
//beginning
rule example
{
8 * { x 1.5 ry 45 hue -20 }
6 * { x 1 s 1.1 ry -35 hue 10 }
box
}
// makes this into a rule which can be called up by the name
//example
1 * { z 20 } 5 * { y 2 s 0.9 } example
// sets the location 10 away in direction z, then creates it five
// times modified in size and y location
// the second bracket builds the structure 2 units up in
//direction y
//to put it on the same level as the original add y -2 to the
// first bracket
This image was rendered with the internal raytracer, which creates shadows. The script with instructive notes follows:
set seed 45
set seed 45
// ambiguous rules have two rules with the same name.
rule a1
{
8 * { x 1 ry 45 hue 30 } box
}
// this makes a ring of boxes.
rule a1
{
1 * { y -1} 8 * { y 1 ry 45 hue -30 } box
}
// This makes a stack of boxes starting on the same level.
1 * { s 20 0.1 20 y -5 color grey } box
// This makes something for them to sit on.
// Colors can be defined by hex code (#ff3ad5 or #f3d) or by
// preset names like grey, white, etc.
10 * { z 3 ry 45 } a1
// this creates ten instances, selecting at random between
// box and stack each time
//every time you build it, it will change unless you use the
// set seed command
No comments:
Post a Comment