3 ms·
Neat, although the fun begins when you try to fill them since you cannot just ignore the primitives anymore if a vertex touches the near plane but instead you h
by badsectoracula 9y ago
Neat, although the fun begins when you try to fill them since you cannot just ignore the primitives anymore if a vertex touches the near plane but instead you have to clip the primitive :-). Also without a z-buffer hidden surface removal becomes tricky if you want to avoid bad overlaps.
For fun i made a 3D thing a few years ago, you can check it here:
http://runtimeterror.com/pages/badsector/nyan/test.html http://runtimeterror.com/pages/badsector/nyan/test.html
The code does the clipping part (triRender function) although HSR is painter's algorithm with a simple sorting (triSort) with a heuristic (triCompare) that i came out through trial and error (because of the distortion introduced by the perspective projection this doesn't always work and IIRC i'd need to actually split the polygons for better result but i was too lazy for that :-P).
Note that i wrote this for fun a few years ago, i am not a web dev nor really follow web tech. This is the biggest block of JavaScript code i've written for years :-P.
- yummybear 9y agoI liked the game - even if simple. Reminds me of Hunter: https://en.wikipedia.org/wiki/Hunter_(video_game) https://en.wikipedia.org/wiki/Hunter_(video_game)
- mysterydip 9y agoThose two things are what got me with mine I made back in 2009. I had filled and shaded polygons, models with animations, and good framerate for the time, but then I ran into issues with z sorting and frustum culling in larger scenes. Still, was a great learning experience and I'm actually using some of the knowledge again for a retro game I'm working on.
- cr0sh 9y agoFor something you wrote for fun, this particular engine is pretty impressive. It was reminiscent of the old PC virtual reality software engine, REND386 (by Bernie Roehl and Dave Stampe): http://buter.software/rend386/ http://buter.software/rend386/ I played around a lot with that engine "back in the day". Modded a Power Glove to hook up to the parallel port (I also did the same for the Amiga), and I used a slightly modified VictorMaxx Stuntmaster for an HMD when it became available. I had fun playing the little game you made in this engine. I think its very impressive (heck, you should throw it up on github). There used to be a thing in the late 1990s and early 2000s of something called the "3D Engine List" that listed all the 3D engines in various languages and whatnot (both open source and commercial). Eventually, that all went away for one reason or another. I kinda wish it still existed. When someone shares such work, it always brings a smile to my face. So thank you for sharing your work with us!
- badsectoracula 9y agoI actually had 3D Construction Kit and Freescape engine in mind when i made this. I've heard of REND386 before, but i had forgotten about it until you mentioned it. I never managed to use it though. I downloaded the code from the site, but it seems to require a version of Borland C++ i do not have. I might try to "port" it to BC5 at some point. EDIT: i forgot. The 3D Engines List (i suspect you mean [1]) lives in DevMaster's DevDb [2]. DevDb was originally just engines and IIRC its initial data was from another database site "3dengines.net" from around 2004, which itself sourced the 3D Engines List. [1] http://web.archive.org/web/20060107015234if_/http://cg.cs.tu-berlin.de:80/~ki/engines.html http://web.archive.org/web/20060107015234if_/http://cg.cs.tu... [2] http://devmaster.net/devdb http://devmaster.net/devdb
- vivekseth 9y agoThis is amazing, thanks for sharing!