News for hackers. Stuff that matters.
Re:Show HN: 3D Raycasting Engine in JavaScript by mrspeaker on Tuesday March 31, 2020 @02:45PM (#22740988)
Ha ha - very interesting use of React... I love that the columns are components!

Though my "negative nancy" comment would be that this is the wrong tool for the job (or at least, it could use a little renaming?) because after jumping from Scene to App to useCastRays hook... I finally found all the actual logic in "utils": which I'm always suspicious of ;)

Anyhoo - really cool, I'd like to see how the 2D sprites are integrated!

Re:Show HN: 3D Raycasting Engine in JavaScript by ahuth on Tuesday March 31, 2020 @03:33PM (#22741531)
Definitely a misuse of React! And for whatever reason, naming is always an issue for me. Need a better name than "utils" for sure.

One thing that surprised me about this is how fast the browser renders 320 absolutely positioned divs that are constantly updating.

But then I thought about it some more, and realized that many websites these days probably have way more DOM and DOM manipulation than that going on!

Re:Show HN: 3D Raycasting Engine in JavaScript by adamredwoods on Tuesday March 31, 2020 @09:57PM (#22744861)
I applaud the misuse of React!

We've seen a lot of raycasters, so one made with React and hooks isn't a bad thing.

Interesting code of using useRef with your state, and then useEffect to update it every render. A simple/better Redux?

Re:Show HN: 3D Raycasting Engine in JavaScript by xendke on Tuesday March 31, 2020 @04:25PM (#22742138)
As a developer that uses react every day, I'm so glad it was used in this project because I was able to look at the code and understand it quite quickly!
Re:Show HN: 3D Raycasting Engine in JavaScript by ahuth on Tuesday March 31, 2020 @04:28PM (#22742177)
That's the reason I used React in the first place - because I'm very familiar with it. Made it easier to focus on the concepts, not the technology.