index.wxml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <xr-scene ar-system="modes:Plane" id="xr-scene" bind:ready="handleReady" bind:tick="handleTick">
  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="gltf-model" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ship_in_clouds/scene.gltf" />
  5. <xr-asset-material asset-id="standard-mat" effect="standard" />
  6. <xr-asset-material asset-id="mat" effect="simple" />
  7. </xr-assets>
  8. <xr-node wx:if="{{loaded}}">
  9. <xr-ar-tracker mode="Plane">
  10. <xr-gltf id="anchor" model="anchor" />
  11. </xr-ar-tracker>
  12. <xr-node id="setitem" node-id="setitem" visible="false">
  13. <xr-gltf
  14. id="scene-mesh" model="gltf-model"
  15. position="0 2 8" rotation="0 0 0" scale="5 5 5"
  16. states="stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  17. />
  18. <xr-node id="door" position="0 1 0">
  19. <xr-mesh
  20. id="door-mesh" rotation="90 0 0" scale="0.8 1 1.6"
  21. geometry="plane" material="mat"
  22. states="renderQueue: 1, stencilComp: 7, stencilRef: 1, stencilReadMask: 1, stencilWriteMask: 1, stencilPass: 1, stencilFail: 2, stencilZFail: 2"
  23. />
  24. </xr-node>
  25. </xr-node>
  26. </xr-node>
  27. <xr-camera
  28. id="main-camera" near="0.1" far="2000"
  29. background="ar" is-ar-camera clear-color="1 0 0 1"
  30. />
  31. <xr-camera
  32. id="magic-camera" background="default" cull-mask="0"
  33. is-clear-color="false" is-clear-stencil="false" is-clear-depth="false"
  34. />
  35. <xr-node node-id="lights">
  36. <xr-light type="ambient" color="1 1 1" intensity="0.6" />
  37. </xr-node>
  38. </xr-scene>