qlwiki:3d_terrain

3D Terrain

There are in fact two Sinclair QL programs both called 3D Terrain, which happened to be developed in isolation (one in the UK and one in the USA) at around the same time!

Both versions are mapping programs capable of creating a contour map of an area and allow you to output the final output to your printer, as well as altering the various axes and scales, used to plot the image.

The UK version

(written by Ian Thompson and Rich Mellor, and originally published by CGH Services)

This version is based on the original 3D graph program written by Mike Lloyd and published in Sinclair QL World. It allows you to take data which has been created in an Abacus spreadsheet and convert it into a 3D graphical representation. Although it can be used for most types of data, it is ideal for contour mapping of areas (an example is provided which draws a terrain chart of Nidderdale in Yorkshire - full details of how the contour map was created are included).

History and Development of the UK Version

(by Ian Thompson)

It’s now over 20 years ago when 3D Terrain (known originally as TriDT and then as 3DT) was in development, and as a general note, why did no-one put dates on letters back then?! Even newsletters and magazines seemed devoid of any dates… So, the dates here are drawn from memory and from the annotated program development documentation, which thankfully still exist!

Back in 1988, Mike Lloyd presented a four-part series in Sinclair QL World (March, April, May and July issues) that dealt with creating a 3D bar graph of the type we are familiar with today thanks to programs such as Microsoft Excel. It detailed how to build algorithms that turned a numerical grid from a spreadsheet into a 3D bar chart. Mike has always asked that his wife Sue be given credit for contributing a great deal towards the design of the algorithms. (Note, the program SuperBASIC listing REM on line 150 states the original Sinclair QL World article was from 1987 – call it a ‘fingerprint’ error if you like!)

I saw an opportunity to use the algorithms to develop a version to map out geographical regions from Ordnance Survey maps – as a mountain biker and hiker I thought it would be interesting to show the sort of landscapes on which I was careening about! This was started sometime in late 1988, and it remained a personal project for a long while, more to give me a challenge that would keep my programming skills ticking over.

I had been writing and submitting various articles, including program listings, to Sinclair QL World over various years (I even have a letter from Editor Helen Armstrong regarding a series of ‘proto-articles’ as she put it, just as the publication wound up in May 1994). I also had submitted one of my listings to the Public Domain (“Chemistry” – a periodic table tool that was printed in Sinclair QL World Sept 1990), via the PD lists handled at that time by Richard Alexander at CGH Services.

It seemed natural, therefore, to work with Richard to see if 3DT had any commercial possibilities, otherwise I might have simply adapted it into an article series for Sinclair QL World.

Fortunately, Richard agreed that it “sounds a very interesting program” (his note on my first submission of 3DT v1 – at that time called TriDT. Version 1 was completed to a point where I felt confident to show it in August 1990. At that time, it would still have been regarded very much as an ‘Alpha’ release, with rough edges, part-finished feature sets and more than a few errors, especially when used away from my trusty 128k D15 issue JS-ROMed QL – Richard was testing it on a 640K Minerva ROMed QL, Minerva 1.81 with ToolKit 2 enabled. However, it didn’t get a ‘pre-release number’ such as we are used to seeing these days – it was probably not even worthy of a ‘v0.1’ label at that point!

Richard tested several versions up to around v1.2 before we hit a bug – using the SuperCharge SE compiler, the program exhibited several glitches that were just not present in SuperBASIC. Richard suggested that QLiberator or Turbo be used instead. All the Minerva compatibility issues had been resolved and the program was largely functional – probably now just about a ‘Beta’ release. It was then time to sort out the graphics – the basic QL LINE command often drew different lines between the same two points that did not actually go directly on top of one another…

The program was tested with Lightning and SpeedScreen (both software and ROM versions), and the code altered to make use of lng_GRAF_ext and lng_MATH_ext as an option – the user had to copy these to the 3DT medium if they owned a copy, remove a few REMs from the BOOT file and the program did the rest. Because the display was becoming increasingly graphical, Lightning made a big difference – whilst SpeedScreen could be used without any problems, it did not speed up the rendering of images (it did speed up some of the auxiliary stuff, such as listing files on a disk or drive). SpeedScreen also did nothing for the accuracy of the LINE command, so the small glitches in the drawn surface still remained.

At around this time, Richard contacted Simon Goodwin and Mike Lloyd to make sure that we were okay to base the work on Mike’s original Sinclair QL World articles. Simon acted as intermediary to first introduce Richard and the program to Mike and made a few comments about possible improvements to the program. Mike and Richard discussed the program at length by phone. Mike freely gave his permission to use the algorithms, providing we also co-credit his wife Sue! He declined the offer of royalties, saying that was “very interesting to know that someone has made further use of the program” and that it was “reward enough to be acknowledged in the program notes”. He noted that 3DT had “quite a lot of potential” and also mentioned that coincidentally Sue’s “professional training is as a land surveyor” – already at that time 3DT was demonstrated using the ‘NDALE’ data extracted from the OS data for Nidderdale in North Yorkshire, a real landscape.

Rich Mellor was also brought into this part-time team in May 1991, as he had advised on development of more than a few of the CGH program library. He became a co-writer of the final versions of the code, making sure that the SuperBASIC listing was optimised to make use of the Turbo compiler – the Turbo Toolkit was useful, but one of the upshots of the various improvements meant the program only just fitted into a standard 128k RAM – the 50x50 data arrays were built into the program, reserving enough memory to handle the most complex surfaces that the QL could display using its native hi-res graphics mode without the whole lot merging into a solid block. However, the program was already running with multitasking to Psion Abacus and Easel modules, and these would push the memory load to the point where at least 64K extra RAM was needed. In practice, most users would now be using memory upgrades such as Miracle Systems Trump Card or Gold Card – I’d already gone down the Trump Card route by then.

Rich’s first reply included a few corrections, but noted that he was “quite impressed with the program itself – it is neat and simple, and now that it will multi-task with Easel/Abacus, good things could be in store”. High praise indeed!

The QL’s display capability was also the reason why one of Mike’s suggestions wasn’t added, that of implementing full 2-point perspective using a relatively simple modification to the algorithms – it would have looked fine for small grids, but for anything above 30x30 up to the 50x50 max, the detail would have been lost as the ‘facets’ that made up the 3D surface merged towards the vanishing points.

Development versions went up to 1.7 before it was considered ‘release-ready’ in November 1991. I wrote the final version of the manual and 3DT was officially released in mid-1992 under the new name 3D Terrain, over 3 years after I first began toying around with the idea. The delay was due to unforeseen circumstances from Richard’s point of view, but allowed a few final tweaks to be made, (version 1.10 was finished by Rich in Feb 1992), at which point it became v2.0, and went on sale from CGH Services for £12.50.

A PC version for Windows 3.11 and then Windows 95 was planned (I even dabbled in Visual BASIC and Delphi to see if it could be ported across), but since spreadsheets developed to such a point in the mid 90s where they were presenting 3D data like this more effectively, there was no demand and this version was not pursued.

The program was released as freeware in 2016 in recognition of the 30th Anniversary of RWAP Software

Around May or June I read an article in Sinclair QL World that happened to include a partial listing of a boot program for a program called ‘3D Terrain’. I initially became worried that a leak had occurred, but it was a different boot program from the one ‘my’ 3D Terrain used. Still, I told Richard, who checked around with various sources, including Simon Goodwin, and we came to the conclusion that it was simply a coincidence. However, from what we could establish, ‘my’ 3D Terrain predated this other version by over a year – it had just taken so long to finish that the other title made the press first.

A month or so later, this other 3D Terrain was reviewed in Sinclair QL World. It turns out that this program was of US origin and was more specialised in that it could not accept user data – it drew surfaces based on mathematical functions. As such, we felt that we had a better claim to any title with ‘Terrain’ in it, especially as the Nidderdale sample was still included, an actual terrain, and featured in every review or advert of ‘my’ version.

The US version

(written by Mike James and published by Digital Precision Ltd)

This version was released at about the same time, and whilst it has more options for manipulating the display of the data, it can only process the datamaps which are supplied with the program, thus limiting its usability.

Following a sale of the rights of the program to Digital Precision Ltd, this version of 3D Terrain was included in the QMaths 2 package.

(by Mike James)

This program was originally developed by me using SuperBASIC CPort but I sent the program to Digital Precision for help, after I ran into problems using their C compiler. They helped me fix the very simple syntax problem, and then offered to buy it, so that the math routines I had developed could be included in their “QMATHS 2” package.

I had come up with a way to combine "terrains" (formulas that would normally be individually plotted) as well as some randomization routines that could be overlaid over that, which is what got their interest. The software itself was basically a "math demo" for people who perhaps wanted to design terrain for games, etc..

Whilst this final version now compiled with Turbo runs much more quickly than the original, it is simple indeed, compared to the original - it originally had some randomization options, allowing users to create more variations in the plots. The original program also could take up to an hour to plot the drawings, before it was compiled with Turbo.

https://youtu.be/rMXYMPoBbig|Watch this video on You Tube

A copy of the UK version of 3D Terrain was sent for review to Sinclair QL World, and Bryan Davies reported back in the October 1992 edition. Bryan had also reviewed the US version earlier that year, so was in a good position to compare them.

Bryan noted that the two programs shared a name, but little else. However, he commented that the UK version of 3D Terrain "feels generally faster, and is not likely to have you wandering away to do something else while the screen is redrawn" and that when multitasking with other programs the screen refresh "was instant with Shift-F4" – a testament to the neat code and optimised routines in 3D Terrain.

The trade-off for accuracy and speed was clear – the Nidderdale plot took seconds to draw on 3D Terrain, and yet was acceptable for most uses, compared to minutes or even hours for the much more mathematically-intensive US program.

Bryan also praised the clarity of instructions for the user, including the use of optional modules from Lightning (a bundled run-time version was considered during development, but eventually not included).

One of Bryan’s final comments perhaps contained more about the future than we had so far seen – “The emphasis on micro software is currently very heavily on graphic presentation, and simulated three-dimensional modelling of this sort is a common business tool in business computing.”

The UK version of 3D Terrain has also been reviewed in QL Today, by Jochen Merz.


Screenshot of Sinclair QL 3D Terrain by Ian Thompson and Rich Mellor
Title: 3D Terrain (UK Version)
Language: SuperBASIC compiled with Turbo BASIC Compiler
Author: Ian Thompson and Rich Mellor
Publisher: CGH Services and RWAP Software
Year of Publication: 1992
Platforms Suitable for: All Sinclair QLs and emulators with at least 192K RAM
Commercial Status: Freeware
Price as at October 1992: £12.50
Reviews: Sinclair QL World October 1992, IQLR Sep/Oct 1992 (Vol 2 No 3)
Sources Available from: n/a
Latest Version available from: Sinclair QL Homepage


Screenshot of Sinclair QL 3D Terrain by Mike James
Title: 3D Terrain (US Version)
Language: SuperBASIC compiled with Turbo BASIC Compiler
Author: Mike James
Publisher: Digital Precision Ltd
Year of Publication: 1992
Platforms Suitable for: All Sinclair QLs and emulators with at least 384K RAM
Commercial Status: Commercial
Price as at November 1992: Unknown (included as part of the QMaths 2 package
Reviews: Sinclair QL World October 1992
Sources Available from: n/a
Latest Version available from: Unknown

  • qlwiki/3d_terrain.txt
  • Last modified: 2018/05/12 14:44
  • by normandunbar