‹ BackHN Continuity

Thread

Divide by depth for instant 3D

219 points · 39 comments · gabrieloc

  1. JKCalhoun · · focus · HN ↗
    Like the post, I wrote an old-school 3D engine that does the same math—renders flat-shaded polygons in an HTML5 Canvas.

    Demo: <a href="https:&#x2F;&#x2F;engineersneedart.com&#x2F;Phosphor3DTest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;engineersneedart.com&#x2F;Phosphor3DTest&#x2F;

    (cursor keys drive the sand crawler, square-brackets change FOV)

    Sources: <a href="https:&#x2F;&#x2F;github.com&#x2F;EngineersNeedArt&#x2F;Phosphor3D" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;EngineersNeedArt&#x2F;Phosphor3D

    (I was seeing a few anomalies and sent Claude to investigate—found a math error or two. There are still some anomalies in depth sorting the polygons but not due to the code, I believe—instead the model itself.)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.