# @casual-simulation/three 中文文档

规范地址：https://npmcn.com/package/%40casual-simulation/three/

版本：0\.161\.2
npm 元数据更新时间：2024-02-19T19:02:31.515Z
中文译文更新时间：2026-11-09T05:13:27.706Z
软件包许可：MIT

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

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

弃用说明：This version is broken\. Use v0\.140\.3 instead

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

- 包体积（解压后）：30.1 MB，966 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2021-02-26T20:24:36.232Z
- 最新版本发布：2024-02-19T18:42:28.580Z
- 近 30 天下载量：8812（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：10（近 12 个月 0 个）

## 中文简介

JavaScript 三维库 - 为 CasualOS 优化

## 安装

```sh
npm install @casual-simulation/three
```

也可以使用：`pnpm add @casual-simulation/three`、`yarn add @casual-simulation/three`、`bun add @casual-simulation/three`

## README

# 3.j 但优化用于 [伤亡情况](https://github.com/casual-simulation/casualos)

[![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) [![DeepScan](https://deepscan.io/api/teams/16600/projects/19901/branches/525701/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=16600&pid=19901&bid=525701) [![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( animation );
document.body.appendChild( renderer.domElement );

// animation

function animation( time ) {

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

    renderer.render( scene, camera );

}
```

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

### 复制此寄存器

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

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

### 更改日志

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

## 常见问题

### @casual-simulation/three 是什么？

JavaScript 三维库 - 为 CasualOS 优化注意：该包已被作者标记为弃用——This version is broken\. Use v0\.140\.3 instead

### 如何安装 @casual-simulation/three？

在项目目录运行 npm install @casual-simulation/three，或使用 pnpm add / yarn add / bun add。

### @casual-simulation/three 支持 TypeScript 吗？

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

### @casual-simulation/three 支持 ESM 还是 CommonJS？

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

### @casual-simulation/three 可以商用吗？

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

### @casual-simulation/three 的下载量有多少？

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

### @casual-simulation/three 还在维护吗？

最新版本 0\.161\.2 发布于 2024/02/20（2 年前）；至今共发布 10 个版本，其中过去 12 个月发布了 0 个；首次发布于 2021/02/27。作者已将其标记为弃用，新项目建议寻找替代方案。

