Commodore User


Vic Graphics

Author: Kevin Smart
Publisher: Duckworth
Machine: Commodore Vic 20

 
Published in Commodore User #3

Vic Graphics

Vic Graphics is Nick Hampshire's second book for the Vic, the somewhat controversial Vic Revealed preceding it. Did he adopt the same style, in other words producing a technical book for above-average users? Does it have as many mistakes?

Vic Graphics is a 192-page paperback at the not unreasonable price of £6.95. Bookshop browsers should have little trouble spotting it, for it sports a flashy eye-catching cover. Impulse buyers beware, though, because placed right at the back on the outside cover is a blue sticker which declares "the Commodore Super Expander cartridge is required to run the programmes (sic) in this book".

OK, you do have the cartridge. So what about the book? The back cover states enthusiastically "This book provides the reader with an introduction to programming techniques used to generate graphic displays" and "Vic Graphics is a must for every Vic user". The emphasised words suggest it is suitable for novices - which is not the Vic Revealed style.

Inside

Let's take a look inside. The first thing your eyes meet after the contents page is, reasonably enough, the 'overview'. Here the author whets our appetite for more with such things as simulations, computer games (nearly everyone jumps for joy!), computer art and computer-aided design. As it happens, these are hardly mentioned in the book - or not even covered at all.

What do you get in terms of the actual contents? The book is divided into seven sections each consisting of several programs (invariably spelt 'programmes') on a specific topic. Accompanying text describes the program, how to run it, and the program stucture; and sometimes there's a picture of what you get.

The programs, you will be pleased to hear, do actually work (makes a change!) and have been wisely dumped straight on to a Vi (or is it a Pet?) printer. The opening section is titled 'colour plotting' and starts with a description of how to control colour in high resolution and multicolour modes (incidentally this is an edited version of pages 137 to 142 of Vic Revealed: fortunately most of the errors have been corrected).

The first program we encounter is 'random colours'. It is not worth typing in: all it does is place large colour blocks on the screen (Vic manual standard!). The program in my opinion does not "generate interesting effects" as promised.

But the second program is slightly better. It POKEs a crude map of North America onto the Vic's normal screen. Unfortunately the good impression is spoiled by the accompanying narrative: for example, the description of lines 100 to 140 say that the screen colour is cyan when in fact it is blue.

Ah well. There is also a very curious comment that reads "make sure that the paper colour is identical to that of the background colour already plotted". Very odd, because this sounds so much like it is referring to the Spectrum... and it's not just a coincidence, as you'll soon find out.

'Rainbow' is really the first program to use any main Super Expander commands. It illustrates the limitations of the high-resolution colour display by drawing a rainbow out of semi-circles.

Improving

It gets better too. 'Fan' is quite a nice program (yes, I can dispense praise as well).

There is another mistake in the text, however - we are told this is the last program in the colour section, when in fact another one follows it!

That is called 'Colours', and it was probably not worth the bother anyway. It simply draws a circle and paints it in with an entered colour: nothing spectacular at all - especially since it could be done on a single line and not the 65 lines that this program takes. You want proof?

10 SCNCLR:INPUTC:REGION C:GRAPHIC 2:CIRCLE 2,512,475,245,350:PAINT 2,512,475

This program marks the end of the colour section. You'll notice there's no use at all of multi-colour mode (one of the Vic's best features). This is an incredible oversight on the author's part.

Onto high-resolution graphics. The first 14 of its 58 pages describe the theory behind hi-res and have been taken from Vic Revealed: nothing wrong with that - after all, Nick Hampshire wrote Vic Revealed - but this time the errors are not corrected! We come face to face with such a monstrosity as:

IF A="*" THEN 30

...and half the theory is incorrect anyway.

There is, however, a nice entry for those people who did not observe the blue sticker at the back of the book: a Basic line-plotting program that allows you to alter the spacing between dots - unlike the Super Expander DRAW command (although the drawn line's coordinates do not strictly agree with those entered).

On The Other Hand

Wait until you read the text, though. For example, take this sinister line: "Foremost of these drawbacks [referring to the DRAW command] is that it uses relative coordinates". Now, relative coordinates." Now, relative coordinates are certainly not what the Vic uses: it uses absolute coordinates with a fixed origin. Relative coordinates are the distances away in X and Y directions from a variable origin. Which computer uses relative coordinates? Why, it's the Spectrum. Funny, the Spectrum seems to be appearing quite a lot.

'Arc 1' was the program which revealed all. As I've said, the Spectrum has been indirectly featured in the book; but I couldn't conclude anything until I found real proof. This came on page 71. How about this piece of text referring to the DRAW command? "Whether we use it in conjunction with the third parameter, namely the angle through which it must turn..."

This is absolute rubbish! The Vic's DRAW command cannot directly draw arcs: neither does it always "start off from the last point plotted". What does? Why, the Spectrum of course. The Spectrum command has three parameters - DRAW X offset, Y offset, Angle.

After this, I was not surprised subsequently to come across a book titled 'Spectrum Graphics' by one Nick Hampshire which includes the same pictures and the same programs in Spectrum format.

At Last - A Real Gem

'Interpolate' is an excellent program and probably the most useful in the book. Data is entered on two program lines; the program very cleverly scales it to fit the screen area and interpolates between a certain number of points by drawing the lines between them. It is quite fast, too; and what's more, there are hardly any mistakes in the text!

The next section is titled 'Using the Video memory'. A slightly strange title, to be sure, since only one of the programs in it does directly access the video memory.

'Hi-res cursor' allows the user to move a small cross around the screen. The key choice (5,6,7,8) was a bit mysterious until I realised that these correspond to the cursor arrows on the Spectrum keyboard! 'Hi-Res Cursor 2' is similar, except it does not erase the background.

'Character building' allows you to create your own characters very easily on a grid and then adds handy DATA statements to the end of the program. Nice and very useful. It is one of the few programs in the book which have been written specifically for the Vic.

The text says that the program will not run with the Super Expander cartridge in place (what about the blue sticker?). The reason is that memory pointers are changed to accommodate the function key definitions. But there are solutions. Simply type:

POKE 642,4:POKE 643,0:POKE 644,30:POKE 648,30:SYS 64824

... and the program should work with any memory configuration and without removing the Super Expander.

The next section is on scaling and stretching. 'Scale 1' allows you to specify the scaling factor of a shape and the Vic will then draw the new shape: a useful enough demonstration of dilation (that's what they call it in school). I suppose the piece of text which reads 'S3/41' should read 'S=1'. 'Scale 2' is similar to 'Scale 1' except the centre of dilatation is the centre of the shape. Again, useful in the classroom.

'Stretch 1' only allows the user to stretch the shape parallel to the X and Y axes while 'Stretch 2' allows you to stretch the shape along any angle. It is quite a complicated program; and the author tells us "many excellent books have been written on the subject" (but which books?).

Moving On

The first program in the 'Rotating and Moving' section is called 'Rotate'. We are told that the program rotates a cross around a central point. Actually the cross does not rotate around the central point simply because it always remains parallel to the axes. It is not true rotation around a point, merely a circular movement of the cross.

On the other hand, 'Rotate 2' does perform true rotation around a point. This time a line is rotated and we can see that all the lines would pass through one point. 'Rotate 3' is an excellent example of true rotation. It allows the user to alter the shape, central coordinates and angle of rotation. Definitely of use as a teaching aid.

And now to the last exciting section on '3D Displays'. They are not true 3D display programs, of course: they only represent 3D objects in two dimensions (your TV screen). The programs use some very complicated mathematics - but thankfully this time the author refers us to a textbook.

Last Words

My conclusion? Vic Graphics is a rehash of Spectrum Graphics to the point that in places the text has been modified only to read 'Vic' instead of 'Spectrum'. Mr. Hampshire, this is not good enough!

What's worse, this means that the programs do not use the Vic's maximum graphics display potential: and as a result there are not many outstanding programs in the book.

It also leads to inefficient programming. This is the main cause of most of the errors in the text.

I cannot dismiss the fact though that all the programs work; and to most people this is of primary importance. The book is not an introduction to techniques but a demonstration of them - though many useful routines can be salvaged from the programs such as the input routine.

All in all, Vic Graphics is not an introduction to techniques but a demonstration of them - though many useful routines can be salvaged from the programs such as the input routine.

Kevin Smart