Three.js 小程序 WebGL 的适配版本。
可参考 example 目录下的示例项目或参照以下流程:
npm install --save threejs-miniprogram
安装完成之后在微信开发者工具中点击构建 npm。
import {createScopedThreejs} from 'threejs-miniprogram'
Page({
  onReady() {
    wx.createSelectorQuery()
      .select('#webgl')
      .node()
      .exec((res) => {
        const canvas = res[0].node
        // 创建一个与 canvas 绑定的 three.js
        const THREE = createScopedThreejs(canvas)
        // 传递并使用 THREE 变量
      })
  }
})
© 2023 mianshi8.net MIT license
