index.wxml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <xr-scene id="xr-scene" bind:ready="handleReady" bind:tick="handleTick" ar-system="modes:Plane;camera:Back">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
  4. <xr-asset-load type="gltf" asset-id="basket" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/laundry_basket/scene.gltf" />
  5. <xr-asset-material asset-id="standard-mat" effect="standard" />
  6. </xr-assets>
  7. <xr-physics></xr-physics>
  8. <xr-node>
  9. <xr-ar-tracker mode="Plane" bind:ar-tracker-state="handleARTrackerState">
  10. <xr-gltf model="anchor" wx:if="{{!showTarget}}"></xr-gltf>
  11. </xr-ar-tracker>
  12. <xr-node node-id="targetTransform">
  13. <xr-node id="targetRoot" wx:if="{{showTarget}}">
  14. <xr-node scale="0.2 0.2 0.2" position="0 -0.3 0">
  15. <xr-gltf model="basket"></xr-gltf>
  16. <xr-node cube-shape="size: 0.01 3 2" position="-1.3 0 0" shape-interact="collide: true"></xr-node>
  17. <xr-node cube-shape="size: 0.01 3 2" position="1.3 0 0" shape-interact="collide: true"></xr-node>
  18. <xr-node cube-shape="size: 2.3 3 0.01" position="0 0 -1" shape-interact="collide: true"></xr-node>
  19. <xr-node cube-shape="size: 2.3 3 0.01" position="0 0 1" shape-interact="collide: true"></xr-node>
  20. </xr-node>
  21. <xr-node cube-shape="size: 10 0.001 10" position="0 -0.3 0" shape-interact="collide: true"></xr-node>
  22. </xr-node>
  23. </xr-node>
  24. <xr-camera
  25. id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1" position="0 0 50"
  26. background="ar" is-ar-camera
  27. >
  28. </xr-camera>
  29. <xr-shadow id="ballRoot" node-id="ballRoot"></xr-shadow>
  30. </xr-node>
  31. <xr-node node-id="lights">
  32. <xr-light type="ambient" color="1 1 1" intensity="1" />
  33. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  34. </xr-node>
  35. </xr-scene>