As seen in this example, we imperatively modify the rotation of the cube every frame. This imperative way of updating a value is very atypical for React development, but necessary to maintain high performance. The rule of thumb is that once something needs to be regularly updated multiple times per frame, we should move it into a useFrame hook and update it imperatively.
Now let's talk about AI, because it's also changing how we build for the 3D web. Specifically, AI changes how we can code 3D web apps, but also how we can generate assets, such as 3D models, textures, sounds, and animations. AI approaches to, for instance, 3D model generation have come a long way and are great for prototyping and especially useful for new developers who are not yet familiar with the sometimes very complex tooling landscape in the 3D world.
Developing AI, specifically large language models, for the development of 3D web apps is challenging because of three reasons. First, most large language models haven't seen enough 3D specific examples. They can create basic scenes, but once you ask for advanced features or ecosystem-specific APIs, they start hallucinating. Secondly, the React 3 and WebXR landscape move quickly. New libraries, new APIs, breaking changes, so models get outdated fast. And lastly, LLMs don't think well in 3D yet. They can describe but not visualize geometry or spatial relationships accurately.
Let's use AI to convert our boring startup project into a sneaker configurator. First, we use Trellis, a 3D model generation AI, to convert an image of a white sneaker into a 3D model. Next, we remove the rotating boxes from our app and add our sneaker model using the glTF component from the React 3.3 library. And we use the handle component from the React 3.0 handle library to make the model grabbable. Then, we use the DrawCode.ai app to generate a 3D user interface for our sneaker configurator, which generates code using the React 3.0 UIKit library, which we can directly copy into our app.
With all these capabilities available to 3D web developers, I believe that 3D web can become or might already be the new creative frontier. As traditional front-end development is more and more automated by AI, building 3D web apps is still an area where engineers and designers have the edge to express their creativity. If you want to get started or continue with your 3D web development journey, I can recommend to take a look at the documentation of React 3 Fiber and the whole React 3 ecosystem, the 3GS journey from Enno Simon, the React 3 Fiber course from Baba Sensei, the Fancy Learning Pages course from Paul Hentschel, and I can also recommend to join the WebXR Discord, the Pomondos Discord, of course, and also the Web Game Dev Discord.
Comments