3 ms·
Here's my (old) take on a terrain renderer (more than 20 LOC, oh well): http://lou.wtf/earf-html5/ http://lou.wtf/earf-html5/ For anyone who wants a refreshin
by namuol 9y ago
Here's my (old) take on a terrain renderer (more than 20 LOC, oh well):
http://lou.wtf/earf-html5/ http://lou.wtf/earf-html5/
For anyone who wants a refreshing/fun code project, strongly recommend implementing some kind of software renderer. A raytracer or raycasting engine like this one, or something more fundamental like a polygon renderer.
- antjanus 9y agowhat would you say is the best resource for learning about building one from scratch in JS?
- s-macke 9y agoThe simplest techniques for 3D rendering without relying on a GPU and WebGL are indeed (2.5D) raycasting engines (such as this Voxel Space engine). A short google search reveals for example: http://www.playfuljs.com/a-first-person-engine-in-265-lines/ http://www.playfuljs.com/a-first-person-engine-in-265-lines/ Also read the readme file of this Voxel Space engine. Maybe this is already enough to understand the principle.
- phkahler 9y agoLoading .obj files is pretty easy, and basic triangle rasterization isn't too hard either. Still probably a bit harder than height maps.
- namuol 9y agoI followed Inigo Quilez's article on terrain marching: http://iquilezles.org/www/articles/terrainmarching/terrainmarching.htm http://iquilezles.org/www/articles/terrainmarching/terrainma... Be sure to browse his other articles: http://iquilezles.org/www/index.htm http://iquilezles.org/www/index.htm and his awesome video tutorials (which tend to be more about the math than the code): https://www.youtube.com/user/mari1234mari https://www.youtube.com/user/mari1234mari Enjoy!