Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
8c98d4e
git(feat) 添加示例
FelixZC Apr 16, 2024
2562526
feat(examples) 添加示例
FelixZC Apr 16, 2024
259f999
feat(demo) 添加示例2
FelixZC Apr 16, 2024
1a8187d
refactor(demo) 重置贴图
FelixZC Apr 16, 2024
7eb9071
refactor(src) 代码重构
FelixZC Apr 24, 2024
2ed3883
feat(demo) 添加简单示例旋转效果
FelixZC Apr 24, 2024
cc186df
refactor(src) three实例化代码拆分
FelixZC Apr 25, 2024
4a21086
docs(utils) 注释补充
FelixZC Apr 25, 2024
39c112f
feat(three) 添加光效控制面板
FelixZC Apr 25, 2024
c2a6b19
fix(style) 修改容器附加canvas错误问题
FelixZC Apr 25, 2024
820e0bb
docs(readme) 文档补充
FelixZC Apr 25, 2024
46a0fd6
refactor(src) 修改代码的结构
FelixZC Apr 25, 2024
9b263eb
refactor(utils) 整合默认配置
FelixZC Apr 25, 2024
cc2611a
feat(demo) 添加模型引用
FelixZC Apr 25, 2024
08b1241
docs(readme) 文档更新
FelixZC Apr 25, 2024
c769cdc
refactor(utils) 合并初始化代码
FelixZC Apr 26, 2024
ab7e4ce
test(component) 移除测试用例
FelixZC Apr 26, 2024
b0bbb31
refactor(src) 结构调整
FelixZC Apr 26, 2024
b7077d9
test(component) 修改测试代码
FelixZC Apr 26, 2024
9a1e8fe
refactor(model) 解耦模型动画
FelixZC Apr 29, 2024
78388e3
feat(utils) 添加像素烟花
FelixZC Apr 29, 2024
013c933
feat(demo) 添加星空效果
FelixZC Apr 29, 2024
0747545
feat(utils) 添加烟雾效果
FelixZC Apr 29, 2024
b34d2d2
docs(md) 文档更新
FelixZC Apr 29, 2024
4f4a59e
feat(demo) 添加物理模拟
FelixZC Apr 30, 2024
9986d27
refactor(animate) 优化旋转动画
FelixZC Apr 30, 2024
1098d2f
fix(animate) 还原选择方法,修改错误引用
FelixZC Apr 30, 2024
a84016d
refactor(init) 解耦three初始化类方法
FelixZC Apr 30, 2024
0242a71
refactor(utils) 动效拆分
FelixZC Apr 30, 2024
0c3fca0
refactor(src) 代码拆分,文件重置命名
FelixZC Apr 30, 2024
5010a3d
fix(utils) 修复glsl加载问题
FelixZC Apr 30, 2024
ae0ea5c
refactor(src) 整理glsl相关文件结构
FelixZC Apr 30, 2024
376025e
feat(demo) 添加鼠标左键射球功能
FelixZC May 1, 2024
571d62b
docs(dmeo) 添加注释
FelixZC May 2, 2024
7d551a6
feat(utils) 抽取物理世界构造方法
FelixZC May 2, 2024
302f628
feat(src) 添加随机颜色球
FelixZC May 2, 2024
35a4169
feat(demo) 添加模型碰撞
FelixZC May 2, 2024
dea0e4f
feat(demo) 添加浮旋方块碰撞检测
FelixZC May 2, 2024
1c2dab7
refactor(utils) 修改烟花效果为空格键发射
FelixZC May 2, 2024
a683602
refactor(demo) 示例代码优化
FelixZC May 2, 2024
aa89eeb
refactor(effect) 优化烟花爆炸效果
FelixZC May 2, 2024
b8d6e9a
test(utils) 移除测试代码
FelixZC May 3, 2024
996da18
feat(init) 添加天空盒
FelixZC May 3, 2024
a6fb6c9
fix(utils) 修改过时参数引用
FelixZC May 3, 2024
7fb4990
refactor(effect) 重写爆炸效果
FelixZC May 3, 2024
19bb67b
refactor(effect) 移除烟雾效果
FelixZC May 3, 2024
d6a52ce
refactor(effect) 移除烟雾效果
FelixZC May 3, 2024
663135f
Merge branch 'master' of https://gitee.com/felixzc/three-practice
FelixZC May 3, 2024
5452e28
docs(readme) 文档说明更新
FelixZC May 4, 2024
05545c0
refactor(model) 整合gltf模型加载
FelixZC May 20, 2024
1a9c04f
refactor(model) 分离模型物理逻辑
FelixZC May 23, 2024
8f5769b
feat(model) 添加旋转动画
FelixZC May 23, 2024
39819bd
feat(demo) 添加中国地图板块示例
FelixZC May 29, 2024
5d8d22f
refactor(src) 目录结构调整
FelixZC May 30, 2024
1148e1e
git(refactor) 项目分离与合并
FelixZC Jun 11, 2024
4d8ad31
refactor(src) 项目分离与合并
FelixZC Jun 11, 2024
6614fd1
Merge branch 'master' of https://gitee.com/felixzc/three-practice
FelixZC Jun 11, 2024
386b974
refactor(src): merge project from shader-project
FelixZC Jun 11, 2024
57cd410
style(package): add cz
FelixZC Jun 11, 2024
2f2ba1c
git(assets) 修复资源引用错误
FelixZC Jun 11, 2024
7b4ec3e
docs(md) 文档描述更新
FelixZC Jun 11, 2024
78d08d9
refactor(src): transfer js to ts, add definition
FelixZC Jun 27, 2024
9db2e12
style(src): fommat style
FelixZC Jun 27, 2024
16bfa82
feat(add font): 添加3D字体,整合物理逻辑
FelixZC Jul 1, 2024
9740d2e
style(format code): format code by plugins
FelixZC Jul 5, 2024
7e3435d
refactor(utils): extract code
FelixZC Jul 22, 2024
3436028
feat(base2): add demo base2
FelixZC Jul 24, 2024
46034b4
feat(component): add fps
FelixZC Jul 25, 2024
a191391
feat(component): add physics_ammo_break
FelixZC Jul 26, 2024
d4196a3
feat(component): add css3d_periodictable and controls_map
FelixZC Jul 29, 2024
69ff4ff
feat(component): add mdd model and load example
FelixZC Aug 7, 2024
5c0c868
feat(component): add toon example
FelixZC Aug 9, 2024
fe55eff
feat(component): add texture vedio and mirror
FelixZC Aug 14, 2024
8214e9f
feat(component): add multiple scenes and views examples
FelixZC Aug 16, 2024
4c4b11b
feat(component): add points_sprites example
FelixZC Aug 19, 2024
3835818
feat(component): add shadermap example
FelixZC Aug 21, 2024
6499bb5
feat(component): add postprocessing examples
FelixZC Aug 24, 2024
d3e41c2
feat(component): add buffergeometry examples
FelixZC Aug 28, 2024
fdbe168
feat(component): add gpgpu_birds_gltf example
FelixZC Aug 29, 2024
29bb006
feat(component): add webautio_orientation
FelixZC Aug 30, 2024
64cc6a5
docs(md): update readme.md
FelixZC Sep 2, 2024
e678c56
feat(shader) 添加圆,三角,雷达片元着色器示例
FelixZC Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
**/IntegrationServer/WmRepository4/
**/IntegrationServer/XAStore/
**/IntegrationServer/packages/Wm*/

node_modules
36 changes: 0 additions & 36 deletions README.en.md

This file was deleted.

86 changes: 62 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,75 @@
# three-practice
# three-toolkit

#### 介绍
Web 3D练习,从入门到入土
Web 3D,从入门到入土

#### 软件架构
软件架构说明
#### 示例
<img src="docs/images/three.png" alt="这是图片的描述0">
<img src="docs/images/three(1).png" alt="这是图片的描述1">
<img src="docs/images/three(2).png" alt="这是图片的描述1">
<img src="docs/images/three(3).png" alt="这是图片的描述1">
<img src="docs/images/three(4).png" alt="这是图片的描述1">

#### 功能
**已实现功能**
1. **基础组件设置**
- **渲染器**:配置 WebGL 渲染器的各项参数,如抗锯齿、sRGB 输出编码、尺寸调整、设备像素比、背景颜色,并添加窗口 resize 事件监听。
- **相机**:创建透视相机,设定视角、宽高比、近/远裁剪面距离,设置初始位置和更新投影矩阵。
- **灯光**
- **环境光**:添加全局环境光。
- **定向光**:创建定向光,可调整颜色和强度。
- **场景**
- **场景创建**:初始化场景对象。
- **雾效**:添加雾效,可调节雾的颜色、起始距离和结束距离。
- **交互功能**
- **OrbitControls**:实现相机的旋转、平移、缩放交互。
- **GUI 控制面板**
- **光照控制**:调整环境光和定向光的颜色和强度。
- **雾效控制**:调整雾的颜色、起始距离和结束距离。
- **辅助工具**
- **坐标轴辅助线**
- **网格辅助**
- **平面辅助**
- **点光源辅助**
- **聚光灯辅助**
- **方向光辅助**
- **相机辅助**

#### 安装教程
2. **3D模型加载**
- 使用模型加载器(如 `THREE.GLTFLoader`、`THREE.ObjectLoader`)加载多种格式(`.gltf`, `.glb`, `.obj`, `.fbx` 等)的 3D 模型。
- 对加载的模型进行位置、旋转、缩放和材质属性的调整。

1. xxxx
2. xxxx
3. xxxx
3. **动画与关键帧**
- 定义并播放关键帧动画,利用 `THREE.AnimationMixer` 和 `THREE.KeyframeTrack` 进行控制。
- 通过 `THREE.AnimationClip`、`THREE.AnimationAction` 等 API 实现精细的动画管理。

#### 使用说明
4. **粒子系统**
- 使用 `THREE.Points` 或 `THREE.PointsMaterial` 创建粒子系统,实现诸如烟雾、火焰、星空、雪花等效果。
- 结合 `THREE.ShaderMaterial` 和自定义着色器实现复杂的粒子效果。

1. xxxx
2. xxxx
3. xxxx
5. **物理模拟**
- 集成第三方物理引擎(如 Cannon.js 或 Ammo.js),使用对应的插件(如 `THREE.CannonPhysics` 或 `THREE.AmmoPhysics`)。
- 为场景对象添加物理属性,处理碰撞检测、重力、刚体动力学等。

#### 参与贡献
6. **用户交互**
- 实现除 OrbitControls 以外的交互方式,如射线拾取(`THREE.Raycaster`)、鼠标拖拽旋转、触摸手势识别(如集成 Hammer.js)。
- 根据交互结果更新场景状态、触发特效或动画。

1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
7. **音频与音效**
- 添加背景音乐和空间化音效,利用 `THREE.AudioListener`、`THREE.Audio`、`THREE.PositionalAudio`。
- 使用 `THREE.AudioLoader` 加载音频文件,并通过 `THREE.AudioAnalyser` 实现音频可视化。

8. **后期处理效果**
- 使用 `THREE.EffectComposer` 结合 `THREE.ShaderPass` 实现景深、模糊、色彩校正、噪点、像素化等后期处理效果。
- 利用 `THREE.ShaderLib` 提供的着色器或编写自定义 GLSL 着色器实现独特的视觉效果。

#### 特技
9. **多视图与分屏显示**
- 创建多个相机、渲染器和 canvas 元素,实现不同视角的并列显示或分屏布局。
- 使用 `THREE.StereoCamera` 实现立体视图,或 `THREE.WebGLMultisampleRenderTarget` 提升抗锯齿效果。

1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
**待实现功能**

1. **性能优化**
- 使用 `THREE.LOD` 实现细节层次,根据相机距离自动切换模型的低模和高模版本。
- 采用 `THREE.BufferGeometry`、`THREE.InstancedBufferGeometry`、`THREE.InstancedMesh` 优化相似对象的渲染。
- 利用 `renderer.info` 监控渲染统计信息,据此调整渲染策略以降低 GPU 负荷。
Binary file added docs/images/three(1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/three(2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/three(3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/three(4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/three.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: {
es6: true,
node: true,
browser: true
},
extends: ["eslint:recommended", "plugin:prettier/recommended"],
ignorePatterns: ['node_modules/', 'dist/'],
rules: {
"prettier/prettier": "error"
}
};
Loading