index.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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>
  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-assets>
  6. <xr-node>
  7. <!-- plane -->
  8. <xr-ar-tracker mode="Plane">
  9. <xr-gltf model="anchor"></xr-gltf>
  10. </xr-ar-tracker>
  11. <!-- marker -->
  12. <!-- <xr-ar-tracker id="lockTracker" mode="Marker" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/marker/2dmarker-test.jpg">
  13. <xr-node id="lockItem">
  14. <xr-gltf model="butterfly" anim-autoplay position="0.2 0 -0.2" scale="0.6 0.6 0.6" rotation="0 -50 0" />
  15. <xr-gltf model="butterfly" anim-autoplay position="0.4 0 0.3" scale="0.5 0.5 0.5" rotation="0 -50 0" />
  16. <xr-gltf model="butterfly" anim-autoplay position="-0.3 0 0.3" scale="0.4 0.4 0.4" rotation="0 -50 0" />
  17. </xr-node>
  18. </xr-ar-tracker> -->
  19. <!-- 识别成功后放置的世界位置 -->
  20. <!-- marker 会动态创建并放在root下 -->
  21. <xr-shadow id="root"></xr-shadow>
  22. <xr-camera
  23. id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1"
  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>