# @gnsx/three 中文文档

规范地址：https://npmcn.com/package/%40gnsx/three/

版本：0\.187\.5
npm 元数据更新时间：2026-11-04T10:49:30.682Z
中文译文更新时间：2026-11-16T17:24:45.329Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40gnsx/three
原文对照：https://npmcn.com/package/%40gnsx/three/?lang=original
项目主页：https://threejs.org/
源码仓库：https://github.com/mrdoob/three.js

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：21.7 MB，1299 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2026-05-15T02:47:33.915Z
- 最新版本发布：2026-11-04T10:49:30.470Z
- 近 30 天下载量：5548（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：70（近 12 个月 70 个）

## 中文简介

JavaScript 三维库

## 安装

```sh
npm install @gnsx/three
```

也可以使用：`pnpm add @gnsx/three`、`yarn add @gnsx/three`、`bun add @gnsx/three`

## README

# 3个j

[![NPM Package](https://img.shields.io/npm/v/three)](https://www.npmjs.com/package/three) [![Build Size](https://badgen.net/bundlephobia/minzip/three)](https://bundlephobia.com/result?p=three) [![NPM Downloads](https://img.shields.io/npm/dw/three)](https://www.npmtrends.com/three) [![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/three/badge?style=rounded)](https://www.jsdelivr.com/package/npm/three) [![Discord](https://img.shields.io/discord/685241246557667386)](https://discord.gg/56GBJwAnUS)

#### JavaScript 三维库

该项目的目的是创建一个方便使用,轻量级,跨浏览器,通用的3D库. 目前所构建的架构仅包括WebGL和WebGPU渲染器,但SVG和CSS3D渲染器也作为外加子提供.

[实例](https://threejs.org/examples/) —— 说 [文档](https://threejs.org/docs/) —— 说 [手动](https://threejs.org/manual/) —— 说 [维基](https://github.com/mrdoob/three.js/wiki) —— 说 [移动](https://github.com/mrdoob/three.js/wiki/Migration-Guide) —— 说 [问 题](https://stackoverflow.com/questions/tagged/three.js) —— 说 [论坛](https://discourse.threejs.org/) —— 说 [解析器](https://discord.gg/56GBJwAnUS)

### 使用量

这个代码创造了一个场景,相机,和一个几何立方体,它将立方体添加到场景中. 然后它就创造了一个 `WebGL` 场景和相机的渲染器,它把取景口加到 `document.body` 键。 最后,它为相机动画了场景内的立方体.

```javascript
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 );

}
```

如果一切顺利,你应该看看 [这个](https://jsfiddle.net/w43x5Lgh/)。 。 。 .

### 复制此寄存器

以所有历史来克隆回波导致~2GB下载. 如果你不需要整个历史,你可以使用 `depth` 参数可以显著地减少下载大小.

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

### 更改日志

[释放](https://github.com/mrdoob/three.js/releases)

## 常见问题

### @gnsx/three 是什么？

JavaScript 三维库

### 如何安装 @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 和提交记录判断。

