# three-model-view **Repository Path**: yangchunlei/three-model-view ## Basic Information - **Project Name**: three-model-view - **Description**: 3D模型导入 预览 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-02-07 - **Last Updated**: 2024-05-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Simple3D ## 目的 - 使用 Three.js 解析、加载、预览 3D 模型文件 ## 用法 - macOS 或 Linux 运行 `yarn build` - Windows 运行 `yarn build-win` 代码构建成功后, 将 `dist` 下构建成功的文件拷贝至工程目录 `public` 等静态目录下,或者,将文件拷贝至 OSS,使用 iframe 调用。 ## 参数说明 使用 URL 进行参数注入 | 参数名称 | 值 | 描述 | 默认值 | | --------- | ---- | ------------------ | ------ | | path | url | 模型存储地址 | '' | | panel | 1、0 | 右上角控制面板 | 0 | | infoPanel | 1、0 | 左上角模型信息面板 | 0 | 例如: ```js import React, { useEffect, useState } from "react"; const ThreeDPreview = () => { const [url, setUrl] = useState(""); const queryModalPath = () => { setTimeout(() => { const modal = "https://*/*.FBX"; setUrl(modal); }, 1000); }; useEffect(() => { queryModalPath(); }, []); return (