Bottom     Contents

Introduction

Graphito is a graphics programming system and tool kit for the generation and manipulation of images. It can be used:

  1. as a picture generation language in its own right, enabling even novice programmers to use powerful tools to produce interesting results.
  2. as a unique, visual and exciting way to learn structured programming
  3. as a graphics tutor enabling a user to build up expertise in programming.
  4. as a graphics package to design advertising material simple CAD facilities, educational software etc.

Graphito contains two types of material

  1. pre-drawn motifs and alphabets
  2. BASIC procedures that act upon these motifs and alphabets.

The material is grouped together in six modules, each of which produces images of a certain type (two-dimensional, colour, etc.)

The method for producing a Graphito image is as follows:

  1. Select the module that contains the material you require.
  2. Load this module from disc or tape.
  3. Write a BASIC program making use of the material in the module. At its simplest this program will be a list of procedure calls, but any normal BASIC features (e.g. FOR ... NEXT loops, SOUND statements) can also be used.
  4. Run the program.

Graphito resources

Modules

Graphito contains a large number of resources. Because of the limited memory available on the BBC Micro and Electron, they have been divided into six modules. There are four modules for producing two dimensional images, and two for three-dimensional images. Some of the resources appear in more than one module.

2DMOD1 A two-dimensional module that allows images to be generated that connsist of (transformed) text and motifs, and uses interaction.

2DMOD2 A limited version of 2DMOD1 that makes some of the two-dimensional resources available in MODES 0, 1 and 2. This allows interactive painting and colour mixing.

2DMOD3 A version of 2DMOD1 that concentrates on the generation of network or wallpaper groups using both the supplied resources and icons that are interactively designed.

2DMOD4 A two-dimensional module that includes mathematical and recursive patterns as resources as well as the resources of 2DMOD1. It also contains some of the network generations of 2DMOD3.

3DMOD1 A thee-dimensional module that allows the two-dimensional resources to be thickened into three-dimensional objects and manipulated in three-dimensional space. It also allows the user to decorate three-dimensional objects such as cubes and spheres with motifs and text.

3DMOD2 A three-dimensional module that allows users to set up their own three-dimensional objects and view these from any viewpoint Partial hidden surface removal is incorporated in this module

Each module starts with a program prelude which optimizes the memory resources. Details of how you can alter the preludes for particular purposes are given later on in the manual.

Motifs and alphabets

There are 34 predrawn motifs and six alphabets that can be used in the two-dimensional modules or expanded into three dimensions and used in 3DMOD1. In 3DMOD2 there are four predefined three-dimensional objects available. The motifs and alphabets are obtained by loading procedures in a module. See the descriptions of PROCIoad, PROCloadalpha, PROCalphaslice, PROCload3Ddata, and PROCmotif3D towards the end of this manual for a fuller treatment of the available material.

Procedures

The motifs and alphabets are handled and transformed by procedures. There are over sixty of these. All the procedures are listed in alphabetical order later in the manual with full instructions on how to use them.

Using Graphito

This manual has been arranged to give tutorial help to first-time users and to act as a comprehensive reference guide once experience has been gained

Each module is described and instructions on how to use it are given. These instructions include a list of the Graphito procedures available in the particular module. For a full description of each procedure and its effect consult the alphabetical section later in the manual. Many examples of Graphito programs and the results they produce are given. Try entering some of these for yourself, and seeing how they work. This is probably the best way to become familiar with Graphito.

Screen coordinates

Many procedures in the two-dimensional modules will require coordinates of positions. The screen origin (0,0) is at the bottom left hand corner of the screen. The Screen coordinate system is 0 to 1279 units in the x direction and 0 to 1023 in the y direction. Point (640,512) is, therefore, approximately at the centre otthe screen.

For the three-dimensional modules the situation is different, and slightly more Complicated. There are no absolute coordinates: the user must define a position ffOm Which to view the three-dimensional scene. A full description of how this works IS given in PROCviewpoint on page 105.

Graphito on tape

The material in Graphito is stored on tape in files arranged as follows:

Side A Side B
2DMOD1 BEETLE ORCHID BRITAIN
2DMOD2 BUS PARROTS IRELAND
INTERAC BUTFLY RABBIT EUROPE
2DMOD3 CANNON RHINO EUROPEF
2DMOD4 CITRUS ROSE AFRICA
3DMOD1 EAGLE TELEPH AUSTRA
3DMOD2 ELEPHA THISTLE NAMERI
EPSONPR FISH TRANSIT SAMERI
MODE5BL FLOWER TRICOP ALPHA1
MODE1BL GULL TURTLE ALPHA2
MODE2BL GUN UMBREL ALPHA3
HELMET VASE ALPHA4
MUSHRO VEGTAB

You will probably find the tape easier to use if, for each side in turn, you catalogue where the files start. Rewind the tape fully, set your tape counter to zero, type *CAT, press RETURN, then play the tape. As the name of each file appears on the screen note down, against the name of the file in the list above, the tape counter reading. You can then use this list to help you locate files later on.

You can also save the files you use in a particular program onto another tape. To save a file, e.g. BEETLE, the procedure is as follows. Find the beginning of the file on the Graphito tape, type *OPT 1,2 and press RETURN, and then type *LOAD BEETLE and press RETURN. Now play the tape and the file will load onto your Computer- While the file is being loaded onto the computer the file name will appear on the screen and the number of blocks in the file will be counted off. When the file is fully loaded the filename will have four numbers (in hex) after it like this

BEETLE 08 03C7 00006518 00006518
These are Filename no. of blocks size of file start address execution address

Now put the tape onto which you want to save BEETLE into your recorder and type *SAVE BEETLE start address +size, i.e. *SAVE BEETLE 651B +3C7, and press RETURN and the record button on your tape recorder. The file BEETLE will now be stored on the tape. Note that you can ignore any zeroes at the start of the hex numbers.

Graphito on disc

The Graphito disc is 40 track, single sided, single density.

Error messages

Most of the error messages that arise in Graphito will be 'normal' BASIC errors because Graphito programs are written in BASIC.

The BASIC error that is most likely to occur is

No such FN/PROC

This will appear if a Graphito name, be it a motif, alphabet or procedure, has been misspelt, or uppercase letters have been used instead of lower.

Another error message which may appear is

Not enough HIMEM allocated

This means that a program prelude has been altered incorrectly, or not included.

The message

No such variable

referring to a line within the procedure library will appear if an attempt has been made to draw a motif or alphabet without previously loading it.

Most logical errors in graphics programming Will be visually apparent The following list may help you to diagnose the more puzzling faults.

Symptom Possible cause
Blank screen Plotting is taking place off the screen because wrong values have been entered in a procedure
OR
No drawing procedure has been called
Intermittent straight lines appear A very large value of 'scale' is being used or has accumulated
Small dot appears - nothing else happens A very small value of 'scale' is being used or has accumulated
Changes of motif size or position are taking place exponentially Failure to use PROCinitialise

Next     Top