May 21, 2021 WeChat Mini Program Development Document
The .js a suitable version of the small program WebGL.
You can refer to the sample project in the example directory or to the following process:
npm install --save threejs-miniprogram
Once installed, click Build npm in the WeChat Developer Tool.
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 变量
})
}
})