APPLICATIONSCREATION GRAPHIQUE ★ Amstrad Block Graphics ★

Amstrad Block Graphics (Computing with the Amstrad)Applications Creation Graphique
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

THIS program will take you into the realms of Amstrad graphics and gives quite a good 3D effect by building up a picture of a racing car in the same way as a child would build it with Lego.

As with building bricks, we can build a structure several layers thick. This, together with the colour range of the Amstrad, means we can create some effective pictures.

The routine is not perfect. It is meant to show what can be done and to stimulate a few ideas - and, of course, to give you a utility to incorporate in your own routines.

We shall be creating a 3D picture in a similar way to that used to form 2D pictures - constructing a three dimensional combination from the standard 8x8 character matrices used when printing.

Characters can be arranged together, and new ones can be redefined, so that the final size and shape of the picture is limited only by screen size.

The character printing subroutine takes the normal character or a user-defined one and creates from it a set of cubes in the same positions as dots would be in the printed character.

Figure I shows the transition we make in this program. The cube routine simply draws a cube of the required size in the position given to it. By drawing the cubes in a row from the deepest position to the shallowest, we eliminate the hidden edges.

The routines are driven by the print string subroutine at line 1200. This will take the string in s$ and print it to the screen in block form.

This section requires some variables to be set. Before we call it we need to give values to:

basexThe top left position of the string.
baseyVertical position of top left of the string.
angleAngle of the string, below horizontal.
thickThickness of lettering.
wideWidth of each cube printed.
deepHeight of each cube printed.
mthick
mwidth
mdeep
Maximum values for above.


The maximum values relate to the ability to increase the size of the print as the string is processed. In this way the string appears to be coming out of the screen in true 3D form.

The subroutine will take an average of the start and end values and adjust the size of intermediate characters accordingly. The angle of the string is that at which the characters slope.

The subroutine has been kept simple by only allowing for strings to be printed on a downslope from left to right. Printed cubes automatically eliminate those immediately behind them or those that cannot be seen.

If you wish to use other directions you must work out which faces of the cube are showing and draw the string so that the nearest characters are drawn last. The precise angles and sizes of the strings are more a question of trial and error than theory.

The small section of machine code at the end moves the character matrix to a position in store where Basic can read it. The character definitions are held in the lower ROM. The routine enables this ROM, calls a subroutine to find where the definition for the current character is, and then moves the eight byte sequence to location 42020 onwards.

The main routine can then pick up each of these values to test each of the bits. If a bit is set the cube routine will draw the block.

Any character can be used, as the routine prints whatever is in the string.

I have redefined two characters to produce the racing car and have printed different sizes of the letter 0 to produce the wheels. This the racing car is made up of three layers -the far back wheel can still be seen over the car.

Adjust the base positions and the sizes to get the required layout for your particular picture.

Now that we are able to draw our picture we should consider how to put colour into it. In Mode 0 the Amstrad gives us 1 6 pens with which to paint our picture, and the pen colours can be freely selected from the palette of 27 inks.

I have set up all my pen colours in the initialisation routine at line 1 700. This sets the ink of each pen.

The cube drawing routine will draw cubes with the pens shown in Figure II. The variable cc holds the pen for the front face, and we increment this number for the top face and again for the side face.

In the program I have used pens 1, 2 and 3 for the "Amstrad" string, face and car body, and pens 4. 5 and 6 for the car wheels.

By using a number of colours, and by overprinting with user-defined or normal characters, we can build complex and attractive pictures.

The routine could be extended in several ways - increasing definition, changing the cube drawing to something more exotic like a cylinder, or following a curve rather than a straight line. One idea would be to put other pen colours on to the tyres and then change these pen colours in a loop.

This would give a form of colour animation and the car wheels would appear to be turning.

As the program stands, it is interesting to see such lively effects from such a simple routine. Perhaps on some future computers we shall have this facility as standard in the ROM routines, maybe with a three dimensional (multi-colour?) character set.

The way that computer graphics are moving using three dimensional effects, I wouldn't be surprised if it was here sooner than we think.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1986
★ AUTHOR: IAN MORTON
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» Amstrad  Block  Graphics    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-20
DL: 170
TYPE: ZIP
SiZE: 5Ko
NOTE: 40 Cyls
.HFE: Χ

» Amstrad  Block  Graphics    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2013-09-21
DL: 252
TYPE: PDF
SiZE: 263Ko
NOTE: 3 pages/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Concours Ecran A100% n°03
» Applications » SymPlay/SymVideo for SymbOS
» Applications » Symbol (Amstrad Computer User)
» Applications » CPC-Artist (Schneider Aktiv)
» Applications » Kuma - LOGO Turtle-Graphics Interpreter
» Applications » cdDraw
Je participe au site:
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 634 millisecondes et consultée 1676 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.