index.wxml 1.7 KB

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