Skip to content

Experimentation with 3D math and rasterization on ARMv2

License

Notifications You must be signed in to change notification settings

arkiruthis/armv2_3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

armv2_3D

Description

A small fixed-point 3D mesh renderer for Acorn Archimedes. Written in C89 and ARM assembly. Utilizes the C89 dynamic array by Evan Teran.

Primarily aimed at ARM250 (A3010 / A3020) but code compatible up to RISC PC.

As per the license this software is released AS IS. I don't have the time to look through pull requests, etc., but please feel free to fork the project and play with it as you will. :)

IMAGE ALT TEXT

Prerequisites

QuickStart

  1. Checkout the repo and copy the Project folder into your hostfs folder for your emulator.
  2. At the desktop, open the Acorn C++ tools folder. $HostFS::HostFS.$.AcornC_C++.Tools
  3. Open the Projects folder.
  4. Double-click the Makefile to generate the !MeshRenderer executable.
  5. Run the generated !Run script (which sets some environment variables) to launch.

Controls

F1 - F4: Set Color palette. SPACEBAR: Stop/Start rotation. NUMPAD: 4/6 (Heading), 8/2 (Pitch), 7/9 (Roll)

Implementation notes

This currently uses a very naive rasterizer which renders up to a 4-byte word boundary and then uses STMIA with 4 registers to store 16-bytes of color at a time. This is by no means the fastest way to to do this.

Running on Original Hardware

Use an emulator (Arculator, RPCEmu, ArchiEmu, etc.) to copy the Projects folder onto an ADF and either use that in a Gotek, or use it to prepare a floppy disk. This is to preserve the file types that are set up on HostFS so that they run correctly on native RISCOS.

Thanks

I'm deeply grateful to the community on the Stardot forums who have offered valuable assistance and patiently offered answers to my endless questions.

Gustavo Pezzi (pikuma) - For their superb course on 3D Graphics Programming which provided much needed insight for this project.

Julien Verneuil - For their fantastic online blog post about Archimedes graphics programming. Some great Voxel terrain examples there as well.

ray//.tSCc. - For this fascinating 2005 demo coding article which provided a much better radix sort alternative to qsort() for speeding up the triangle depth pass.

RISCOS.com for making available online much of the documentation that was orginally only available in book form.

David Ruck for his superb TimerMod utility which is available from his site which made profiling many of the routines far easier.

Book References

  • "3D Math Primer for Graphics and Game Development" - Fletcher Dunn and Ian Parberry.
  • "3D Computer Graphics" - Dr Alan Watt
  • "Programmer's Reference Manual" - Acorn
  • "Archimedes Assembly Langauage" - Mike Ginns

About

Experimentation with 3D math and rasterization on ARMv2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published