TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Raycasting in JavaScript and React

66 pointsby ahuthabout 4 years ago

6 comments

mmoskalabout 4 years ago
Such a classic! I remember writing a raycasting engine in DJGPP (GCC for DOS), when I was teenager... Fast forward 25 years and hey, it can be done in TypeScript on a $2 microcontroller ;) (though it did take some effort to get TypeScript to run fast enough...)<p><a href="https:&#x2F;&#x2F;arcade.makecode.com&#x2F;14009-57824-16954-25349" rel="nofollow">https:&#x2F;&#x2F;arcade.makecode.com&#x2F;14009-57824-16954-25349</a> <a href="https:&#x2F;&#x2F;forum.makecode.com&#x2F;t&#x2F;3d-raycasting-in-arcade&#x2F;474" rel="nofollow">https:&#x2F;&#x2F;forum.makecode.com&#x2F;t&#x2F;3d-raycasting-in-arcade&#x2F;474</a>
评论 #26425209 未加载
spartanatreyuabout 4 years ago
My thoughts in order:<p>1. Read title 2. But why? 3. Click link 4. No &lt;canvas&gt; tag? Just html and react? How? 5. Open demo 6. Inspect elements 7. Oh... Gentle chuckle. But why? 8. Remembers Atwood&#x27;s Law
评论 #26420433 未加载
gh123manabout 4 years ago
If you find this sort of thing interesting, I implemented a &quot;Portal&quot; raycasting engine akin to Valves portal game. You can read more about how it works here: <a href="https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gh123man&#x2F;Portal-Raycaster</a>
评论 #26420446 未加载
ehntoabout 4 years ago
Very cool. Don&#x27;t take this as criticism, I am just curious, what do you get out of React with this?<p>You have written a lot of it in pure JS so I can see you&#x27;re not using it as a crutch, but I am not familiar enough with React at it&#x27;s edges to know why you would bring it in to the toolbelt here.
评论 #26422290 未加载
评论 #26420408 未加载
评论 #26424905 未加载
评论 #26421225 未加载
评论 #26420136 未加载
gtremperabout 4 years ago
This is a very well written project. Easy to navigate through the codebase and a pleasure to read.
Lorinabout 4 years ago
So many DOM elements, if you inspect a wall it&#x27;s made from thin slices. Wonder if they could be merged to form complete &#x27;walls&#x27; and then use gradient effect... heck, SVG may be more effective.
评论 #26420384 未加载
评论 #26421240 未加载
评论 #26426607 未加载