1、npm安装threejs
创建vue项目(略)
执行如下命令:安装threejs相关模块
npm install three
npm install three-css2drender
npm install three-obj-mtl-loader
npm install three-orbit-controls
package.json 如下
{
"name": "vue-lk-test",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "npm run serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.0",
"compression-webpack-plugin": "^6.0.3",
"core-js": "^3.6.5",
"nprogress": "^0.2.0",
"postcss-px2rem": "^0.3.0",
"three": "^0.121.1",
"three-css2drender": "^1.0.0",
"three-obj-mtl-loader": "^1.0.3",
"three-orbit-controls": "^82.1.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"vue": "^2.6.11",
"vue-router": "^3.4.7",
"vuex": "^3.5.1",
"webpack-bundle-analyzer": "^3.9.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-c