Saturday, March 30, 2013

STRUCTURE SYNTH BASICS

I've been playing with a program called Structure Synth this week, which has the possibility to create extremely complex imagery with very simple scripts. Ubuntu linux users can find it and the Sunflow renderer in the Ubuntu Software Center. There is an augmented version available from Anandamide, but I can't get it to build in linux. If you search around you can see a lot of amazing pictures people have made with it.  It has limitations, but I like that.  I have done a few architectural type things with it that are kind of interesting.  Like this:


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
// 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



So there you go.  You can change and fiddle with anything in the code, and the program comes with a lot of other examples which will reveal a lot of complexity and potential.  Have fun.

No comments: