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:

basex The top left position of the string.
basey Vertical position of top left of the string.
angle Angle of the string, below horizontal.
thick Thickness of lettering.
wide Width of each cube printed.
deep Height of each cube printed.
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.


★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1986


» Amstrad  Block  Graphics    LISTINGDATE: 2013-09-21
DL: 43 fois
SIZE: 262Ko
NOTE: 3 pages/PDFlib v1.6

Je participe au site:
» Newfile(s) upload/Envoye de fichier(s)
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

» Applications » Dessin (CPC Infos)
» Applications » Relief (CPC Revue)
» Applications » Zeichen-Design
» Applications » Computer - Aided - Designer (CPC Amstrad International)
» Applications » Spectrum Screen Pictures on your Amstrad / Screen Transfert Utility Spectrum to CPC464
» Applications » Graph-it: Game for a Graph


L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 111 millisecondes et consultée 675 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.