index.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. <xr-scene ar-system="modes:Plane Marker; planeMode: 1;" bind:ready="handleReady" bind:ar-ready="handleARReady">
  2. <!-- depthMask: true; depthNear: 0.001; depthFar:1000; depthDebug: true; -->
  3. <!-- Beta 版本 -->
  4. <!-- vio + depth 模式下 planeMode 需设置为 1 (只允许水平面识别) -->
  5. <!-- depthMask 在支持的情况下,是否开启实时深度遮挡。 -->
  6. <!-- depthNear 开启实时深度遮挡时,遮挡的近处阈值。 -->
  7. <!-- depthFar 开启实时深度遮挡时,遮挡的远处阈值。 -->
  8. <!-- depthDebug 开启实时深度遮挡时,显示一个用于Debug的图层。 -->
  9. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  10. <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
  11. <xr-asset-load type="gltf" asset-id="gltf-item" src="https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb" />
  12. </xr-assets>
  13. <xr-node>
  14. <xr-ar-tracker mode="Plane">
  15. <xr-gltf model="anchor"></xr-gltf>
  16. </xr-ar-tracker>
  17. <xr-node node-id="setitem" visible="false">
  18. <xr-gltf model="gltf-item" scale="0.1 0.1 0.1" anim-autoplay="clip: Dance"></xr-gltf>
  19. </xr-node>
  20. <xr-camera
  21. id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1"
  22. near="0.1"
  23. far="100"
  24. background="ar" is-ar-camera
  25. ></xr-camera>
  26. </xr-node>
  27. <xr-node node-id="lights">
  28. <xr-light type="ambient" color="1 1 1" intensity="1" />
  29. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  30. </xr-node>
  31. </xr-scene>