代码拉取完成,页面将自动刷新
Three.js 小程序 WebGL 的适配版本。 COPY自官方的仓库: https://github.com/wechat-miniprogram/threejs-miniprogram
可参考 example 目录下的示例项目或参照以下流程:
通过 npm 安装
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 变量
})
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。