@gnsx/three

中文文档
0.187.5发布于 2026/11/04MITESM + CJS零依赖近 30 天下载 5548

JavaScript 3D library

原始使用文档
文档目录3 节
  1. Usage
  2. Cloning this repository
  3. Change log

three.js

NPM Package Build Size NPM Downloads jsDelivr Downloads Discord

JavaScript 3D library

The aim of the project is to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds only include WebGL and WebGPU renderers but SVG and CSS3D renderers are also available as addons.

Examples — Docs — Manual — Wiki — Migrating — Questions — Forum — Discord

Usage

This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL renderer for the scene and camera, and it adds that viewport to the document.body element. Finally, it animates the cube within the scene for the camera.

import * as THREE from 'three';

const width = window.innerWidth, height = window.innerHeight;

// init

const camera = new THREE.PerspectiveCamera( 70, width / height, 0.01, 10 );
camera.position.z = 1;

const scene = new THREE.Scene();

const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
const material = new THREE.MeshNormalMaterial();

const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );

const renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( width, height );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );

// animation

function animate( time ) {

    mesh.rotation.x = time / 2000;
    mesh.rotation.y = time / 1000;

    renderer.render( scene, camera );

}

If everything goes well, you should see this.

Cloning this repository

Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth parameter to significantly reduce download size.

git clone --depth=1 https://github.com/mrdoob/three.js.git

Change log

Releases

版本与发布记录

@gnsx/three 共发布 70 个版本,首次发布于 2026/05/15;过去 12 个月发布了 70 个版本。

版本发布日期距今
0.187.5latest2026/11/0412 天前
0.187.42026/11/0412 天前
0.187.32026/11/0313 天前
0.187.22026/11/0313 天前
0.187.12026/11/0214 天前
0.187.02026/11/0115 天前

其他发布通道:r184 → 0.184.22,r185 → 0.185.17。

关于 @gnsx/three 的常见问题

@gnsx/three 是什么?

JavaScript 3D library

如何安装 @gnsx/three?

在项目目录运行 npm install @gnsx/three,或使用 pnpm add / yarn add / bun add。

@gnsx/three 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/gnsx__three 是否存在。

@gnsx/three 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gnsx/three 可以商用吗?

@gnsx/three 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gnsx/three 的下载量有多少?

根据 npm 官方下载统计,@gnsx/three 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,548 次,日均约 185 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gnsx/three 还在维护吗?

最新版本 0.187.5 发布于 2026/11/04(12 天前);至今共发布 70 个版本,其中过去 12 个月发布了 70 个;首次发布于 2026/05/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。