clojure-gamedev

Chris McCormick 2021-11-04T01:46:58.020900Z

@tylertracey09 you might find this reference code useful. I used Three.js directly from ClojureScript without any kind of wrapper or what have you. https://infinitelives.github.io/px3d/ https://github.com/infinitelives/px3d

Chris McCormick 2021-11-04T01:48:06.021300Z

threagent looks great thanks for sharing!

Ty 2021-11-04T01:50:47.021900Z

Yeah this is awesome! I dig the rendering style, definitely interesting in diving into the code

Ty 2021-11-04T01:51:13.022500Z

I saw a few examples of raw Three.js stuff and the imperative statefulness of it seemed a bit overwhelming.

Chris McCormick 2021-11-04T01:54:15.022800Z

Yeah it's hard to work with. I would much prefer a declarative approach.

Ty 2021-11-04T02:33:39.023300Z

Gotcha, yeah I think react-three-fiber/threeagent are a good approach for that kind of thing.

Ty 2021-11-04T02:35:43.025700Z

I will say I've done a bit of vanilla js stuff with react-three-fiber, and I found the actual library to be a bit messy. It gets the job done but it is essentially a react concretion where the three.js primitives are generated into react components. It's definitely cool, but I think there's a better approach. Threeagent in general is probably a good start. My current issue with it is that if a threeagent component is rendered by a reagent component, hiccup gets pretty confused and tries to interpret the threeagent primitives as HTML.

👍 1
Chris McCormick 2021-11-04T09:07:45.027100Z

I saw that Three can take a JSON definition of a full scene - something I wanted to test was using this to update the scene dynamically. Probably be slow though.