67
8
Dec 25 '22
Do you want an interactive game? Or just a 3d animation running in the browser?
-24
u/SignHot6352 Dec 25 '22
Isn’t every game interactive?
19
Dec 25 '22
I was asking if he wants an actual game or just an animated 3d scene… Finding Nemo is 3d animated, yet not an interactive game. But yes, to be precise I would say a game is interactive. 😉
12
u/xocrystalcastles Dec 25 '22
Three.js, Babylon JS, or D3.js
6
u/33ff00 Dec 25 '22
You can do this in d3?
11
u/VegasTamborini Dec 25 '22
Nope
4
u/Swagasaurus-Rex Dec 25 '22
I mean if you wrote all the 3d light transport code and shaders and everything… ya I still wouldn’t recommend d3 for this
0
6
u/TheVirtuoid Dec 25 '22
There are some great suggestions here - I personally like BabylonJS. They have some good examples in their documentation.
Just a friendly warning - creating this kind of game is not easy, especially if (like me) you have limited experience in game mechanics. I'm writing a car racing game, and what appears on the surface to be real simple has been a brain-buster. :)
But you will learn a lot - just be prepared to spend some serious time working it out.
4
u/Timotheteus123 Dec 25 '22
I recommend combination of three.js, react, react-three-fiber, drei
7
u/TheRealFloomby Dec 25 '22
Just use three.js or vanilla webgl directly. React is poorly suited for games.
1
u/RobertKerans Dec 25 '22 edited Dec 25 '22
Just to note that three-fiber is a declarative wrapper around three, the additional overhead is tiny -- it's essentially just a different API for the same thing (declarative vs imperative)
Now if you then put that 3d GL stuff inside react-rendered DOM nodes that render/rerender a lot then sure, that'll fry performance straightaway. But if not difference should be minimal
(not saying the wrapper is a good/bad idea or whether it should/shouldn't be used)
3
u/TheDownvotesFarmer Dec 25 '22
React?? Why would you? Better all core with vanilla, react it is a transcompiler
1
u/Timotheteus123 Dec 25 '22
The biggest difference is declarative vs imperative. With React you also get useful stuff, components, logic reuse with custom hooks, reactive state (including jotai or zustand), contexts, memoization, state machines with useReducer or xstate. The cool thing about react is that it's simply a reconciler of components, it can add component systems to non-DOM systems like Three.js objects.
3
u/TheDownvotesFarmer Dec 26 '22
All of it unnecessary and expensive, all of it can be achieved by just using closures.
1
1
1
1
u/KhazadTheBanBender Dec 25 '22
Blender and three.js, these guys can make great things together and in my March learning plan
1
1
1
Dec 25 '22
There’s a “Make Minecraft with JavaScript” tutorial on Youtube, from FreeCodeCamp. Might get you started in the right direction.
1
u/frading Dec 26 '22
Try with https://polygonjs.com, it's a node-based and procedural webgl editor. It has various examples to get you started https://polygonjs.com/docs/examples
1
-11
Dec 25 '22
[removed] — view removed comment
-7
u/SignHot6352 Dec 25 '22
Why the downvotes? I’ve been using chatgpt for coding since it’s release and it’s the best tool I’ve found so far, saves hours of finding answers through Google or Reddit
1
153
u/shuckster Dec 25 '22
It’s an undocumented feature: