gitmyhub

three.js

JavaScript ★ 113k updated 16h ago

JavaScript 3D Library.

A JavaScript library that makes it straightforward to create and display 3D graphics in a web browser using WebGL and WebGPU, without writing raw graphics code.

JavaScriptWebGLWebGPUWeb Audiosetup: easycomplexity 3/5

three.js is a JavaScript library for creating and displaying three-dimensional graphics inside a web browser. The problem it solves is that drawing 3D content from scratch with browser APIs is very low-level and verbose; three.js wraps that complexity in a friendlier set of building blocks so developers can put 3D scenes on a web page without writing raw graphics code.

The way it works follows the standard pieces of a 3D scene. You create a scene, which is the world your objects live in, and a camera that defines what part of the world is visible. You add objects to the scene built from a geometry, which is the shape, and a material, which is what the surface looks like. A renderer then draws everything to the page on every animation frame, and you change object properties like rotation over time to make things move. The README states the goal is an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds include WebGL and WebGPU renderers, with SVG and CSS3D renderers available as add-ons. The topics list mentions augmented reality, virtual reality, and Web Audio as related areas.

You would use three.js when you want to put interactive 3D content on a website: a product viewer that lets visitors rotate an object, a data visualization with depth, an in-browser game, an architectural walkthrough, or an experimental art piece. The README points to extensive documentation, a manual, a large gallery of examples, and a community forum and Discord.

Where it fits