xr-start的index.ts文件要写上Component({})
微信小程序使用 XR-FRAME 组件找不到,按照文档写的?文档地址 [图片] [图片]
12-04wxss中将xr-start改成#main-frame
安卓手机XR-FRAME无法叠加在原生组件(canvas)上面XR-FRAME和canvas相互叠加,XR-FRAME的zIndex设置的更高,在编辑器上XR-FRAME可以显示在上层,但是在安卓手机上,canvas显示在上层。 代码如下: [图片] [图片] 编辑器上表现正常,XR-FRAME在上面: [图片] 安卓手机上,canvas显示在上面: [图片]
12-04看下你们的z-index是不是设置了-1或者上层是不是有元素挡住了
XR-FRAME模型交互点击事件不起作用<xr-scene bind:ready="handleReady"> <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded"> <xr-asset-load type="gltf" asset-id="damage-helmet" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/damage-helmet/index.glb" /> <xr-asset-load type="gltf" asset-id="miku" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/miku.glb" /> </xr-assets> <xr-env env-data="xr-frame-team-workspace-day"/> <xr-light type="ambient" color="1 1 1" intensity="1" /> <xr-light type="directional" rotation="40 70 0" color="1 1 1" intensity="3" cast-shadow /> <xr-gltf node-id="damage-helmet" model="damage-helmet" id="helmet" mesh-shape bind:touch-shape="handleTouchModel"/> <xr-gltf model="miku" position="-0.15 0.75 0" scale="0.07 0.07 0.07" rotation="0 180 0" anim-autoplay id="miku" cube-shape="autoFit:true" shape-gizmo bind:touch-shape="handleTouchModel"/> <xr-camera position="0 1.5 4" target="damage-helmet" background="skybox" clear-color="0.4 0.8 0.6 1" camera-orbit-control /> </xr-scene> // index.js // 获取应用实例 //const app = getApp() Page({ data: { }, // 事件处理函数 onLoad() { }, methods: { handleReady: function ({detail}) { this.scene = detail.value; }, handleAssetsProgress: function ({detail}) { console.log('assets progress', detail.value); }, handleAssetsLoaded: function ({detail}) { console.log('assets loaded', detail.value); }, //模型点击事件 handleTouchModel: function ({detail}) { const {target} = detail.value; const id = target.id; wx.showToast({title: `点击了模型: ${id}`}); } } }) [图片]
11-17