Skip to content
An MS-DOS 3D engine based on high school trigonometry
C++ C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

MS-DOS 3D Engine


I wrote this in my junior year of high school (2001) during my extra time in my programming class. I had also been learning trigonometry, so this entire 3D engine is written with a high school trigonometry and geometry level of knowledge. It's definitely got some divide by zero bug sprinkled throughout, but works overall.


I'm not even going to attempt to figure out how to compile this thing again. At my high school we were just given MS-DOS machines running Turbo C++.


I was able to get this to run on FreeDOS 1.2 using VirtualBox 5.2. I followed the directions here to do the installation. However, I did experience the problem listed in the "Problems with VirtualBox?" section here, but the recommended solution worked.

When prompted for "What FreeDOS packages do you want to install? I only needed to select "Base packages only".

Floppy Disk

OK, so this is the most unfortunate part of this. In high school we were required to do all of our work from a standard 3.5" 1.44MB floppy. So part of this program is hard coded to look at the A: drive.

I used Magic ISO Maker to create a floppy disk image with a copy of the Turbo folder.

Attach this image to your VirtualBox machine.


Start the VM

In an attempt to preserve as much memory address space as possible I run FreeDOS with option "1 - Load FreeDOS with JEMMEX, no EMS (most UMBs), max RAM free". Although I still get out of memory errors after playing with it for a while. I don't remember having this problem in high school, so maybe someone knows how to configure FreeDOS better than me.

Copy Files

Copy the Turbo folder to the C: drive. For some reason I've had trouble running it directly from the A: drive.

xcopy a:\turbo c:\turbo /e

World File

The program is hard coded to load A:\TURBO\WORLD.TXT. There are a few different world files included.




Key Action
Up Look Up
Down Look Down
Left Look Left
Right Look Right
NumPad 8 Look Up
NumPad 2 Look Down
NumPad 4 Move Left (strafe)
NumPad 6 Move Right (strafe)
PageUp Move Up
PageDown Move Down
Tilde (~) Stop
1 10% Speed
2 20% Speed
3 30% Speed
4 40% Speed
5 50% Speed
6 60% Speed
7 70% Speed
8 80% Speed
9 90% Speed
0 100% Speed
Backspace Move Backward at 25% Speed
+ Increase Speed by 2%
- Decrease Speed by 2%
A Rotate the first object in WORLD.TXT
O Options Menu
Z Zoom Radar In
X Zoom Radar Out
Left Mouse Button Fire and Cycle Weapon
Escape Exit
You can’t perform that action at this time.