index.wxml 2.0 KB

1234567891011121314151617181920212223242526272829
  1. <xr-scene ar-system="modes:Hand" bind:ready="handleReady" bind:ar-ready="handleARReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. </xr-assets>
  4. <xr-node wx:if="{{arReady}}">
  5. <xr-ar-tracker id='tracker' mode="Hand" auto-sync="-1 0 9 4 8 12 16 20">
  6. <xr-mesh name="hand" geometry="cube" scale="0.7 0.8 0.1" uniforms="u_baseColorFactor:1 1 1 0.5" states="renderQueue:2500,alphaMode:BLEND"/>
  7. <xr-mesh name="wrist" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:1 0 0 1" />
  8. <xr-mesh name="joint" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 1 0 1" />
  9. <xr-mesh name="thumb" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 0 1 1" />
  10. <xr-mesh name="index" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 0 1 1" />
  11. <xr-mesh name="middle" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 0 1 1" />
  12. <xr-mesh name="ring" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 0 1 1" />
  13. <xr-mesh name="little" geometry="sphere" scale="0.05 0.05 0.05" uniforms="u_baseColorFactor:0 0 1 1" />
  14. <!-- 坐标系提示,单位1 的坐标轴 -->
  15. <xr-mesh node-id="mesh-x" position="1 0 0" scale="2 0.02 0.02" geometry="cube" uniforms="u_baseColorFactor:0.7 0.3 0.3 1" ></xr-mesh>
  16. <xr-mesh node-id="mesh-y" position="0 1 0" scale="0.02 2 0.02" geometry="cube" uniforms="u_baseColorFactor:0.3 0.7 0.3 1"></xr-mesh>
  17. <xr-mesh node-id="mesh-z" position="0 0 1" scale="0.02 0.02 2" geometry="cube" uniforms="u_baseColorFactor:0.3 0.3 0.7 1"></xr-mesh>
  18. </xr-ar-tracker>
  19. <xr-camera
  20. id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1"
  21. background="ar" is-ar-camera near="0.01"
  22. ></xr-camera>
  23. </xr-node>
  24. <xr-node node-id="lights">
  25. <xr-light type="ambient" color="1 1 1" intensity="1" />
  26. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  27. </xr-node>
  28. </xr-scene>