A 3-D software rasterizer written from scratch in nothing but JavaScript

Overview



itch.io β€’ Play in the browser

Tmp3D is a 3-D software rasterizer written from scratch in nothing but plain-old JavaScript, just for kicks. It makes use of the 2d graphics context of the HTML5 <canvas> to draw some graphics primitives and is heavily inspired by OpenGL sub-routines.

The project is still heavily a work-in-progress and in its very early stages, so you may take it as it is and expect many more features to follow very soon.

It currently supports

  • a first-person camera with 2 degrees-of-freedom: yaw and pitch
  • perspective transformations
  • near & far clipping planes
  • back-face culling

and plans to support

  • frustum culling, i.e., triangle clipping
  • depth-sorting
  • flat-shading
  • affine & perspective-correct texture-mapping
  • occlusion culling ( 😩 )

Why?

My main motive for undertaking this project was that it'd be educational, recreational, and entertaining. I may or may not try and make a game with it at some point if I'm satisfied with its progress. So, the fact of the matter is, have some fun while re-inventing the wheel.

Setting up

Requirements

  • Node.js
  • ejs
  • express

After cloning the repository, navigate to the root folder and install the dependencies using npm.

$ npm install

Once all the dependencies are installed, you can start up an Express development server with:

$ npm run start

To enable the debugging features, run:

$ npm run start:debug

Controls

Action Keys
Movement W A S D
Free-look ↑ β†’ ↓ ←, or the mouse*
Change elevation Q E, or MSW*

* You should first click LMB on the canvas to activate mouse controls.

Live Demo

You can check out the live demo here!

Trivia

The project is named after the fact that I'm too lazy to come up with an original name, so I make up a placeholder name to keep me going until the first-ever public release of the project, by which time I had already grown accustomed to the placeholder name and it's too late to come up with a new name, so I decide to go with it thinking I can pretend it is a deliberate choice of a name so I can make some silly backronyms with it.

You might also like...

Avoid setting up a project from scratch. Start using VRTTV πŸŽ‰

Avoid setting up a project from scratch. Start using VRTTV πŸŽ‰

VRTTV Boilerplate Avoid setting up a project from scratch. Start using VRTTV πŸŽ‰ View Demo Β· Report Bug Β· Request Feature πŸ€” What’s this? Are you tired

Nov 24, 2022

This will create a REST API using Express JS and MongoDB removing the hassle of creating everything from scratch.

rest-api-init Fastest way to create REST API with Node.js, Express.js & MongoDB. Prerequisites Node.js needs to be installed. MongoDB Compass needs to

Dec 3, 2022

Build a Blockchain and Cryptocurrency from Scratch

This is a proof of work blockchain. With a fixed price reserve currency. Miners and node operators are needed. To get started follow the instructions in the main readme.md

Nov 10, 2022

This is a boilerplate for creating your own languages for various use cases. You can even create your own programming language from scratch!

Bootstrap compiler This is a bootstrap compiler that can be used to compile to compiler written in the target language. You can write a compiler in th

Nov 14, 2022

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.

Jspreadsheet CE v4: The JavaScript spreadsheet Jexcel CE has been renamed to Jspreadsheet CE News Important: Please import jspreadsheet.css (jexcel.cs

Dec 19, 2022

A collection of (mostly) technical things every software developer should know about

Join our community for professional Software Developers and get more control over your life and career! Every Programmer Should Know πŸ€” A collection o

Jan 4, 2023

Track Apple software update changes with Github Actions

What is this? This repo is scraping known Apple software update URLs and keeps the results in recursively sorted (and therefore diffable) JSON files.

Dec 8, 2022

Team project within the course of Software System Design and Analysis.

Team project within the course of Software System Design and Analysis.

πŸ“— InnoBookCrossing - Application for sharing books at Innopolis gh-md-toc πŸ” General Information Description The application is designed to help peop

Oct 22, 2022

VSCode extension that creates overlay for your Broadcasting Software of choice.

VSCode extension that creates overlay for your Broadcasting Software of choice.

BSOverlay VSCode extension that creates an overlay for your Broadcasting Software of choice. Documentation Please refer to the Wiki Section. Installin

Sep 30, 2022
Owner
Emre
I suck at programming
Emre
a simple wrapper nestjs dynamic module on top of surrealdb.js driver, with a consumer app to show case library in action, nothing fancy

README README Project Components Dynamic Module Consumer App Install SurrealDb Starts SurrealDb Init surrealDb Database Run App from Source Code Launc

MΓ‘rio Monteiro 0 Oct 3, 2022
Responsive, auto-saving To-Do List made from scratch using JavaScript only, but refactoring the code into ES6 standard

Project Name ES6 AWESOME BOOKS Website Name AWSM BOOKS Project Website (GitHub Pages) https://github.com/Zeraltz/es6-awsm-books Clone the Project git

Andres Mauricio Cantillo 5 Jun 25, 2022
How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be trying show off out. Curate the list of gadgets and software and share it with your fans and followers.

Show Off - Showcase your setup! How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be try

Adithya Sreyaj 15 Nov 24, 2022
Responsive, auto-saving To-Do List single page application made from scratch using JavaScript only

Project Name To-Do List Website Name What's Next? (TO-DO List) Clone the Project git clone https://github.com/Zeraltz/todo-list.git Built With HTML, C

Andres Mauricio Cantillo 7 Jun 25, 2022
This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoDB

FARM-Stack-Course This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoD

Bek Brace 121 Jan 2, 2023
Find your new favorite Scratch service.

Welcome to scratch-explorer ?? Like ocular and ScratchStats? You'll love some lesser-known sites like Itinerary and Aviate. Just browse the collection

null 8 Oct 3, 2022
βŒ› Unofficial archive of old Scratch projects

Unofficial archive of old Scratch projects Due to the Scratch Team planning to remove the ability to view unshared projects (LLK/scratch-www#6773), I

Micah Lindley 13 Oct 7, 2022
Makes downloading Scratch projects easy. Simply enter two project IDs and click start.

Makes downloading Scratch projects easy. Simply enter two project IDs and click start. No need to pick the right format or include the assets, all of this is done automatically and in the browser.

null 6 May 27, 2022
Monorepo project that shows the current weather data and weather forecast for next 7 days. Created from scratch to participate in a 14-days hackathon.

Climatic Monorepo project that shows the current weather data and weather forecast for next 7 days. Created from scratch to participate in a 14-days h

Luis Marsiglia 6 Jun 23, 2022