当前位置:   article > 正文

vue项目中安装使用three.js_vue安装three timeout

vue安装three timeout

1, 安装插件   

npm install three --save

2, 在main.js中设置一下,将three.js挂载到vue上: 

  1. import Vue from 'vue'
  2. import * as Three from "three";
  3. Vue.prototype.$three = Three;

页面中使用:

  1. // 1,创建场景对象
  2. this.scene = new this.$three.Scene();
  3. // 创建缓存几何体对象
  4. this.geomery = new this.$three.BufferGeometry();
  5. // 创建环境光对象
  6. this.light = new this.$three.AmbientLight( 0xffffff );
  7. this.scene.add(this.light);

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/91485
推荐阅读
相关标签
  

闽ICP备14008679号