Commit 470ac4d9 authored by xiezhi's avatar xiezhi

更新 README.md 文档

- 修正代码块格式,所有代码块顶格显示
- 更新克隆地址为实际 GitLab 仓库地址
- 简化命令说明,只保留核心的4个命令
- 更新访问端口说明
- 优化故障排除部分
- 更新特性描述,反映9种几何体
parent ee0a0731
......@@ -4,7 +4,7 @@
## 🚀 特性
-**完整的 3D 场景**: 包含多种几何体、光照系统和材质
-**完整的 3D 场景**: 包含9种几何体、完整光照系统和材质
- 🎮 **交互控制**: 鼠标拖拽旋转、滚轮缩放、点击交互
- 🎨 **现代 UI**: 响应式设计,美观的加载动画和信息面板
- 📊 **实时统计**: FPS、物体数量、顶点数量实时显示
......@@ -39,45 +39,39 @@ three.js-template/
### 方式一:本地开发
1. **克隆项目**
```bash
git clone <repository-url>
cd three.js-template
```
```bash
git clone https://gitlab.eazytec-cloud.com/eazy-template/three.js-template.git
cd three.js-template
```
2. **安装依赖**
```bash
npm install
```
```bash
make install
```
3. **启动开发服务器**
```bash
npm run dev
```
```bash
make run
```
4. **访问应用**
打开浏览器访问 `http://localhost:5173`
打开浏览器访问 `http://localhost:8000`
### 方式二:Docker 部署
1. **构建镜像**
```bash
make docker-build
```
```bash
make docker-build
```
2. **运行容器**
```bash
make docker-run
```
3. **访问应用**
打开浏览器访问 `http://localhost:8000`
### 方式三:一键启动
```bash
make start
make docker-run
```
3. **访问应用**
打开浏览器访问 `http://localhost:8000`
## 🎮 控制说明
| 操作 | 说明 |
......@@ -89,57 +83,24 @@ make start
## 📋 可用命令
### 开发命令
### 基本命令
```bash
make install # 安装依赖
make dev # 启动开发服务器
make serve # 启动生产服务器
make build # 构建项目
make check # 检查项目状态
make lint # 代码检查
make test # 运行测试
```
### Docker 命令
```bash
make docker-build # 构建 Docker 镜像
make docker-run # 运行 Docker 容器
make docker-stop # 停止 Docker 容器
make docker-logs # 查看容器日志
make docker-shell # 进入容器 shell
```
### 部署命令
```bash
make deploy # 构建并部署
make restart # 重启容器
make status # 检查服务状态
make start # 快速启动
```
### 清理命令
```bash
make clean # 清理构建文件
make clean-docker # 清理 Docker 资源
make reset # 完全重置项目
make install # 安装项目依赖
make run # 启动应用服务器(生产模式)
make stop # 停止应用服务器
make clean # 清理项目文件
```
## 🔧 自定义配置
### 修改端口
在 `package.json` 中修改启动脚本
使用环境变量配置端口
```json
{
"scripts": {
"serve": "python3 -m http.server 8000"
}
}
```bash
export APP_PORT_1=9000
make run
```
### 添加新的几何体
......@@ -188,24 +149,24 @@ directionalLight.position.set(10, 10, 5);
### 常见问题
1. **依赖安装失败**
```bash
rm -rf node_modules package-lock.json
npm install
```
2. **Docker 构建失败**
```bash
docker system prune -a
make docker-build
```
3. **端口被占用**
```bash
# 查看端口占用
lsof -i :8000
# 杀死进程
kill -9 <PID>
```
```bash
make clean
make install
```
2. **端口被占用**
```bash
# 查看端口占用
lsof -i :8000
# 杀死进程
kill -9 <PID>
```
3. **应用无法启动**
```bash
make stop
make run
```
### 性能问题
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment