User:Kipling/3D objects

= Tutorial: the third dimension in Context Free Art =

While CFA is essentially for two-dimensional graphics, it is possible to produce a variety of three dimensional effects. These include shading, shadows, perspective, figure/ground, layering and the inclusion of objects that are suggestive of a third dimension, such as cubes.

Shading
The simplest shading method is the shaded ball. This is drawn as a sequence of diminishing circles of slowly changing colour. In context free, the natural way to code a rule BALL using a recursive technique, where a single CIRCLE is drawn and then another slightly smaller, slightly brighter BALL inside. Different gradients can be obtained by changing
 * the amount of scaling at each step
 * the amount of brightening in each step
 * the initial colour or target colour (using "|")

Exercise
create a design with a 4 rows of balls (a) row 1 shows variation of outermost brightness, (b) row 2 shows variation of the rate at which the shading brightens (c) row 3 shows variation of the saturation of the centre of the ball (d) row 4 shows variation of the brightness at the centre of the ball

Asymmetric shading
An asymmetric shading simulates light from a particular direction. In this, the copy of the BALL is shifted slightly from the centre of the CIRCLE. This creates a sequence of circles that scale towards a limit point away from the centre of the circle. The small shift can be found by trial and error, by calculation, or by conjugation involving a shift of the limit point to the origin, a scaling, and then a reverse of the original shift.

If the limit point is too far off centre, the highlight looks more natural if it is elliptical rather than round. An elliptical highlight can obtained by scaling by different amounts in the two axes.

Exercise
Create a series of 7 balls where the limit point is at y=0, y=0.1, y=0.2, y=0.3, y=0.4, y=0.45, and y=0.5 and the highlight has convincing brightening rates and shape.

Perspective
This is covered in xxx

Layering
TODO