A&B Computing


Graphito & Tesselator
By Addison-Wesley
BBC/Electron

 
Published in A&B Computing 2.07

Stunning and educative digital design

Grafix

Graphito and Tesselator are software spinoffs from the work of Jim McGregor and Alan Watt from Sheffield University. Their book, The Art Of Microcomputer Graphics, reviewed in the June issue of A&B, lists many of the routines and documents the mathematical and design concepts behind the software.

The results are stunning, educative and, I believe, widely applicable in computer studies, art and design and for highly practical design purposes, packaging, posters, worksheets and so much more.

Graphito

Graphito comes as a 40 track unprotected disc, or on cassette tape. It contains a set of "toolbox" programs and is packaged with a 112 page booklet detailing all the workhorse programs contained in each module. There are examples in BASIC and in the form of screenshots. All the programs examples and graphics generating routines, are in BASIC and an attempt has been made to make them "readable" despite their complexity.

All the layman needs to know is which procedure does what, supply the parameters, perhaps add a BASIC loop structure or two and, hey presto, magical graphics.

At their simplest procedures work like PROCload("GULL") with the filename of the motif to be loaded a string argument in the bracket. More complex procedures take more arguments, e.g. PROCdrawandinflate(640,512,0,0,2,1). This procedure for instance is used in conjunction with others to manipulate motifs on screen. Inflate is quite fun!

Other procedure calls work independently. For example, PROCsnowflake(640,512,1,8,0,33). This draws a snowflake or "Koch flake" pattern centred on the screen at 640,512, with a scale of 1, a resolution (detail in the flake) of 8, and a reduction (ratio of smaller component flakes to whole shape) of 0.33.

The two and three dimensional drawing procedures can be put to work on four supplied alphabets (no characters outside A-Z capitals) and a number of motifs, some of which serve as examples here.

A number of other routines can be used to add features such as windows, to mix text and graphics effectively, to load and save screens, to print them out (MX printer driver supplied) and finally to interact with the setpiece drawing.

This latter feature is restricted by memory but can allow you to apply the Mode 2 colour set in a number of "shades" (mixed pixels) and to complete the line drawing. Joystick control of the cursor is catered for and the whole INTERAC module is reminiscent of Addison Wesley's earlier Electronic Colouring Book (reviewed last year), including the ability to experiment with resetting the logical/physical colour relationship for the complete drawing.

As well as the main 2D/3D drawing programs, a number of other graphics modules allow the simple buildup of motif clusters, networks and wallpaper groups, performing reflection, translation, stretching and shearing.

Text can be drawn horizontally and vertically and each text character treated like any other motif. Motifs can be designed with a sophisticated character designer, which allows a 4 x 4 character (32 x 32 pixel) motif to be constructed, edited, reflected vertically or horizontally and saved as a file to disc.

There are also routines for drawing modified circles. Sierpinski curves, spirals, examples of recursion (procedures calling themselves), to draw squares, snowflakes and tree branching.

It must be plain from my description of the software that it contains some very powerful routines for producing quality graphics on the BBC. The programs do require the user to have some familiarity with the BBC or Electron before they can get the best out of them. Although there are interactive portions, in the main BASIC programs will have to be written in order to exploit Graphito routines. A colour of example screens with inappropriate program examples beneath do little to marr some excellent documentation. A better teach yourself graphics I can't imagine. More worrying was an apparent fault in one of the programs. One of the routines associated with PROCcoloured flake, in 2DMOD4 broke down. At line 4440 DEFPROCsd requires three arguments, and the call at 6210 provides only two! This may be just an early review copy and I'm sure Addison-Wesley will check it out.

Once you have constructed your masterpieces, and if you didn't create them just to learn about computer graphics, there comes the problem of how to reproduce screens for outside use. Photography seems to be the best answer at the moment although some of the higher quality plotters do justice to the intricate networks and patterns. Still, this problem is not the fault of Graphito, a marvellous package for the recreational programmer and student of the computer.

Tesselator

Unlike Graphito, the code which makes up Tesselator is not immediately open to the user's scrutiny. The complex matter of producing tesselations obviously requires the use of assembler.

The programming and documentation are categorised into Escher tesselations, Triangle mosaics, Patchwork patterns, and Penrose tesselations.

*RUN SHAPER and you get a square tile in the middle of the screen. As you distort the shape using the cursor keys, the opposite side of the tile moves to match. When you are happy with your file shape, you let the computer tesselate to any chosen scale factor, thus filling the screen with appropriately sized tile shapes, all interlocking.

The shapes are then saved for future use and decoration. This means that you can use tile shapes over and over again with differing ornamentation. When a shape file is reloaded into DECOR it can be painted, the colour pallette experimented with, further detail added with a "draw" feature, and the drawing area adjusted.

The decoration is also saved in a separate file. Whole screens can be *SAVEd for printing. As well as square translations, the Tesselator drawing grid copes with rotation and reflection of the square. Other starting shapes can be triangles and hexagons. Combination pairs of tile shapes can also be used.

Each available combination of starting shape and tesselation grid can be loaded from a file and each is described in the documentation - which incidentally is of the highest standard as well as illustrating some of the marvellous pictures generated by Tesselator.

Escher tesselations are not the end of this package. Triangle Mosaics are based on a circular pattern of isoceles triangles arranged around a central point. The type of triangle is specified by angle, and any deformations to its side achieved in a similar manner to that described above for tiles. Similar decoration and colouring facilities are also available to complete the picture.

Patchwork patterns are catered for by a highly structured and readable BASIC program, PATCHES. The program allows the designer to pick, drag and rotate a set shape. The program contains hexagon and triangle but DATA statements can be *EXECed onto the standard program to provide more. The basic shape is used to build up the patchwork pattern and each shape can be filled with one of three foreground colours.

Finally Penrose tesselations. Until only a few years ago it was believed that there were no sets of tiles which would only tesselate non-periodically (tiles which do not repeat again and again in the same arrangement). Professor Roger Penrose came to the rescue with his "kite" and "dart" tiles. You too can now play with these intriguing tesselations.

Tesselator is a very comprehensive introduction to the world of tesselations. The programs are easy to use and there are plenty of example files on disc or tape to play with (and show off with). The documentation makes the whole package ideal school material and includes a section on Tesselation and mathematics teaching. There is little point in comparing this with Homerton College's Tesselations. The two packages take different and indeed complementary approaches to the subject.

Both Tesselator and Graphito successfully tackle an awkward area where mathematics and programming crossover. They do it thoroughly, clearly and, best of all, entertainingly.

Mark Webb

Other BBC/Electron Game Reviews By Mark Webb


  • AMX Mouse Front Cover
    AMX Mouse
  • The Basic Editor Front Cover
    The Basic Editor
  • Kopfjäger Und Umziehen Front Cover
    Kopfjäger Und Umziehen