index.wxml 1.6 KB

12345678910111213141516171819202122232425
  1. <xr-scene ar-system="modes:Marker" id="xr-scene" bind:ready="handleReady" bind:ar-ready="handleARReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load type="gltf" asset-id="gltf" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
  4. </xr-assets>
  5. <xr-env env-data="xr-frame-team-workspace-day" />
  6. <xr-node wx:if="{{arReady}}">
  7. <xr-ar-tracker mode="Marker" src="{{markerImg}}">
  8. <xr-gltf model="gltf" anim-autoplay position="0.2 0 -0.2" scale="0.6 0.6 0.6" rotation="0 -50 0" />
  9. <xr-gltf model="gltf" anim-autoplay position="0.4 0 0.3" scale="0.5 0.5 0.5" rotation="0 -50 0" />
  10. <xr-gltf model="gltf" anim-autoplay position="-0.3 0 0.3" scale="0.4 0.4 0.4" rotation="0 -50 0" />
  11. <!-- 坐标系提示,单位1 的坐标轴 -->
  12. <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>
  13. <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>
  14. <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>
  15. </xr-ar-tracker>
  16. <xr-camera
  17. id="camera" node-id="camera" position="0.8 2.2 -5" clear-color="0.925 0.925 0.925 1"
  18. background="ar" is-ar-camera
  19. ></xr-camera>
  20. </xr-node>
  21. <xr-node node-id="lights">
  22. <xr-light type="ambient" color="1 1 1" intensity="1" />
  23. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  24. </xr-node>
  25. </xr-scene>