Tutorials/3D Arrangements

A 2D space can be used to give an illusion of 3D objects, although the illusion is not perfect but in very restricted areas. There are a few tricks to master. Basically:


 * Layering (the z directive) helps to set objects so as to appear behind one another.
 * Movement along the spatial axises (y and x) while decreasing the size of the objects produces an illusion of distance.



In this picture, size ( s .7 ) and the y-coordinate ( y .7 ) produce the illusion in successive recursions. Varying the y increment value ( .7 ) would result in different points of view with respect to the objects. A very small value like .1, would indicate that the viewer eye is on the same level as the objects, for example.

The results get more interesting with variations in color and space, as well as when using more complex objects. In the following picture, a gradual increase in brightness ( b .1 ) produces a mist effect.



In the following image, then, there is a hint of a landscape of alternating hills and valleys.

Now our perspective rule ( forest ) has four alternative definitions that produce a non-deterministic outcome. One of the rules is actually empty, in order to terminate some of the branches of recursion ( in the picture these branches appear where the trees end ). Also note the decrease of alpha saturation ( a -.1 )towards the fake perspective.



As the next step, different kinds of objects can be used in place of the uniform trees above. All that is needed is a common "wrapping" that distributes weights as is best ( see the rule forestobject below ).



It is clear that this technique has its limitations, but with carefully weighed rules and some determination, quite satisfying pictures can be procured. In spite of occasional errors.

Examples from the Gallery
= Fixed arrangements =

It might be inconvenient to give all the power to a recursive perspective rule. There are two techniques to increase your control over the depth of the perspective produced.

In the following picture, a village of some 12 buildings and some trees is portrayed. The houses seem to stand in irregular rows succeeding one another ( though there are some errors on closer look ). Rows it indeed is.

The whole code is not featured here. What we are chiefly interested in is the group of houses and how they are arranged as they are there.



Now it is obvious that this technique works for small villages and the like. Or let's think about an army.



A well ordered group of men. Any problems?

If we try to extend the lines, an obvious hindrance pops up.



The upper corners of the image appear curiously empty. Of course we could think about cropping it out of the picture like in the movies.

A context free grammar can not remember how many units it has used in a rule the previous round, so a special arrangement more sophisticated than that seems really impossible.