Share your repls and programming experiences

← Back to all posts
3D Renderer and Physics Engine
tristanbeedell (47)

It's a 3D graphical renderer and physics engine made with HTML canvas and JS. I didn't use any packages or anything. Honestly I made it ages ago and cannot remember how it works at all. All I remember is that it took forever to build.

arrow keys to move,
space to jump,
scroll to zoom,
drag to rotate.

All of the blocks are generated randomly.

tristanbeedell (47)

@CONNERSTANEK haha I remember this happening. I have a feeling it's a divide by 0 error.

Fhillis (32)

This is really cool, and I love it a lot, do you mind if I fork it and pull it apart, I notice an issue that when two objects take up some of the same space, it doesn't quite know what to do with them and plots one over the other almost at random (i'd like to see if I can get it to render correctly)

tristanbeedell (47)

@Fhillis sure. At the moment it renders the shapes in order of their distance from their center to the camera.
The soting is done in render.js lines 20 to 42 it seems.

kaldisberzins (345)

WOW that is awesome! I found a bug that sadly you probably won't be able to fix: when the block jumps some of the objects around it flicker.