★ APPLICATIONS ★ PROGRAMMATION ★ GRAPHICS (PERSONAL COMPUTING TODAY) ★![]() |
| Graphics (Personal Computing Today) | Applications Programmation |
One of the best features of the CPC464 is its impressive graphics. Easy to use too, as Simon Rockman demonstrates with some stunning programs._ In the recent past computers did not have very impressive graphics. Now computers like the BBC micro and the Amstrad CPC 464 have changed all that. The CPC 464 is particularly powerful in that it has 27 colours. Because it can only display 16 of these at once there is a process known as paletting which allows you to select your colour or 'INK'. Table 1 shows the possible colours. The keywords on the CPC 464 are very well chosen to make it easy to understand the process of putting each ink into a pen. When you change pens you get a new colour to write with; however there are two slight flaws in the process. The first is that the background has an ink colour, so INK 0,13 would set the background, pen 0, to grey. This takes a bit of getting used to but it is not so difficult to deal with. What is slightly more confusing is that changing the ink in the pen re-colours all the existing stuff drawn with that pen. This has some great advantages. If you draw a bar in black (colour 0) using pen 1 on a black background (pen 0), then you can make the bar appear by allocating a different ink to pen 1 . Program 1 shows the effect of this. It looks as if the bar is moving across the screen. However, all that is happening is that the bar is lighting up and switiching off rapidly, just like the signs in Piccadilly Circus.
Because the switching is almost instant it does not matter how complicated the shape is. This is well suited to the kind of games in the little LCD pocket devices. However, since there are only 16 colours available for this switching process the number of objects you can have is limited. Flashing colours can be used in a similar way and because they will keep flashing regardless of what the rest of the computer is doing, it is possible to create the effect of movement. By altering the rate of flash an illusion of acceleration and deceleration can be achieved. Program 2 shows a stationary road, the flashing colours give the impression that you are riding down it. In the world of supercomputers, graphics are getting so complicated and the resolution so high that they rival artwork for quality. Most of the programmers and designers who drive these machines started life as artists and not as computer people, however one thing they all agree on is that you have to learn the associated maths. The only time I ever took any interest in maths at school was when I knew that listening in class meant that I could go home and draw a pretty (if lo-res) picture on my computer. The result was that I learnt how to draw circles. Program 3 shows a neat way of doing this and Program 4 some improvisations on the theme. Flat graphics are all very well but the fun starts when a third dimension is added. Program 5 shows a CPC 464 version of a hump which appeared in the August 1984 issue of PCT for the Commodore 64. If you play around with the values for elevation and angle you can look around most of the figure. Unfortunately the CPC 464 is not capable of drawing a new figure 20 times each second or it would be possible for you to "fly" over and around the figure. This is something best left to the simulators which cost millions of pounds. It would be nice to combine the speed of changing inks with the complexity of a three dimensional figure. This is what the final program does. It produces a tilted beach ball which rotates. Use the 'Z' key to make it go faster and the 'X' to slow it down. Play about with all these programs and see what you can produce. Maths is much more fun when you see it in action.
| ||||||||||||||||||||||||||||