index.wxml 1.8 KB

123456789101112131415161718192021222324252627282930
  1. <xr-scene ar-system="modes:Plane Marker; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
  2. <!-- vio + marker 模式下 planeMode 需设置为 1 (只允许水平面识别) -->
  3. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  4. <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
  5. <xr-asset-load type="gltf" asset-id="gltf-item" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/just_a_girl/index.glb" />
  6. <xr-asset-load type="gltf" asset-id="butterfly" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
  7. </xr-assets>
  8. <xr-node>
  9. <xr-ar-tracker mode="Marker" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/marker/2dmarker-test.jpg">
  10. <xr-gltf model="butterfly" anim-autoplay position="0.2 0 -0.2" scale="0.6 0.6 0.6" rotation="0 -50 0" />
  11. <xr-gltf model="butterfly" anim-autoplay position="0.4 0 0.3" scale="0.5 0.5 0.5" rotation="0 -50 0" />
  12. <xr-gltf model="butterfly" anim-autoplay position="-0.3 0 0.3" scale="0.4 0.4 0.4" rotation="0 -50 0" />
  13. </xr-ar-tracker>
  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.006 0.006 0.006"></xr-gltf>
  19. </xr-node>
  20. <xr-camera
  21. id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1"
  22. background="ar" is-ar-camera
  23. ></xr-camera>
  24. </xr-node>
  25. <xr-node node-id="lights">
  26. <xr-light type="ambient" color="1 1 1" intensity="1" />
  27. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  28. </xr-node>
  29. </xr-scene>