该项目是在vue框架下使用three.js已经把需要的three配置文件已经安装完成
npm install
只需要通过install指令即可运行已经配置好three的项目
npm run sreve
运行项目可查看使用效果,是否安装成功
import * as THREE from 'three' //导入three.js库
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js'; //控制器
import {OBJLoader, MTLLoader} from 'three-obj-mtl-loader'; //.obj和.mtl文件的插件
import {CSS2DRenderer, CSS2DObject} from 'three-css2drender';//three-css2drender 插件
import * as THREE from "three"
const ThreeBSP = require('tthreebsp')(THREE) //导入threeBSP库,需要同时导入three库