News for hackers. Stuff that matters.
Re:Show HN: 3D Renderer Built using 2D HTML Canvas by badsectoracula on Saturday July 15, 2017 @08:06PM (#14779791)
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

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.

Re:Show HN: 3D Renderer Built using 2D HTML Canvas by cr0sh on Saturday July 15, 2017 @11:00PM (#14780246)
For 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/

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!

Re:Show HN: 3D Renderer Built using 2D HTML Canvas by badsectoracula on Sunday July 16, 2017 @08:46AM (#14781757)
I 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...

[2] http://devmaster.net/devdb

Re:Show HN: 3D Renderer Built using 2D HTML Canvas by mysterydip on Saturday July 15, 2017 @08:45PM (#14779890)
Those 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.
Re:Show HN: 3D Renderer Built using 2D HTML Canvas by yummybear on Sunday July 16, 2017 @10:30AM (#14782094)
I liked the game - even if simple. Reminds me of Hunter: https://en.wikipedia.org/wiki/Hunter_(video_game)
Re:Show HN: 3D Renderer Built using 2D HTML Canvas by vivekseth on Monday July 17, 2017 @11:22AM (#14789359)
This is amazing, thanks for sharing!