Hacker News new | ask | show | jobs
by pjtr 2362 days ago
There were also tricks to extend this simple rendering algorithm to allow limited rotations around the other two axes, to look up / down slightly (just move everything up / down; also implemented in the demo here) and to "lean" when steering left / right (just move everything up / down proportional to the distance from the center of the screen; not implemented in the demo here, but visible in the 1992 NovaLogic Comanche example GIF).

There were Turbo Pascal versions of this on websites in the 90s I think, but it seems they were lost.

2 comments

Indeed, look up / down is very simple implemented. Just alter the horizon line position. This works for the human eye for small deviations such as ±20°, but will lead to perspective distortions for higher angles.
Same with leaning. Add one more line of code and tweak the draw call:

    var ylean = (input.leftright*(i/screenwidth-0.5) + 0.5) * screendata.canvas.height / 4;
    DrawVerticalLine(i, heightonscreen+ylean, hiddeny[i]+ylean, map.color[mapoffset]);
It adds a lot to the "feeling" IMO :)
Cool, that works!
> There were Turbo Pascal versions of this on websites in the 90s I think, but it seems they were lost.

You can still find a lot of this old code if you dig for it; lot's of it can be found on various SIMTEL MS-DOS ftp archive sites, for instance. I also think the textfiles site has some of it. Also archive.org might have some of it.

Take a look around using google and such: "ftp msdos source code" etc - you'll find plenty to be sure (and even if you don't find what you're looking for, you're sure to find stuff you weren't expecting!)

The one I remember was "voxel.pas by Steven H Don". A Delphi port survived here: http://tothpaul.free.fr/sources.php?dprgrp.voxel

Searching for "voxel" in https://github.com/nickelsworth/swag/ also finds some very similar tiny Turbo Pascal programs.

A short article titled "Voxel Landscapes 2D and 3D By Scout/C-Lous" described most of the tricks, but I can't find the text anywhere. A similar article by the same author on another topic I found here https://github.com/ggnkua/Atari_ST_Sources/blob/master/Docs/...