【微信小程序】【AR】threejs-miniprogram 安装(76/100)

配置threejs-miniprogram环境
搭建node环境
初始化node工程
npm init
导入threejs-miniprogram
npm i threejs-miniprogram 
注意:安装threejs-miniprogram 后一定要进行 构建npm 否则引用不生效。由于开发工具和版本的关系可能路径有区别已知路径:工具–构建npm;详情-本地设置–启用npm;
threejs-miniprogram 使用
// pages/ar/ar.js
import getBehavior from './behavior'
import yuvBehavior from './yuvBehavior'
const {
   renderExample1} =require('./example1')
const {
   showAR} =require('./threeJSDemos/threeJS_1')
import {
   createScopedThreejs} from 'threejs-miniprogram'
Page({
   
  behaviors: [getBehavior(), yuvBehavior],
  /**
   * 页面的初始数据
   */
  data: {
   
    theme: 'light',
    camera:null,
    scene:null,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
   
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
   
    wx.createSelectorQuery()
    .select('#webgl'
## SmartApi开发工具
全新版本
极小,极快,极限性能的开发调试工具
官网地址:[http://www.smartapi.site/](http://www.smartapi.site/)


## 旧版本不在维护更新
 
                    
                
                
            
        
浙公网安备 33010602011771号