index.wxml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <xr-scene id="xr-scene" bind:ready="handleReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-material asset-id="standard-mat" effect="standard" />
  4. </xr-assets>
  5. <xr-node>
  6. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  7. <xr-mesh node-id="floor-plane" position="0 -1 0" rotation="0 0 0" scale="10 1 10" geometry="plane"
  8. uniforms="u_baseColorFactor:1 1 1 1" receive-shadow
  9. ></xr-mesh>
  10. <!-- glTF -->
  11. <xr-node wx:if="{{gltfLoaded}}">
  12. <xr-node
  13. wx:for="{{gltfIdList}}" wx:for-item="gltfId"
  14. wx:key="gltfId"
  15. >
  16. <xr-gltf
  17. wx:if="{{gltfId == 0}}"
  18. position="-1 -0.46 -1" rotation="0 0 0"
  19. scale="0.6 0.6 0.6"
  20. model="gltf-{{gltfId}}"
  21. cast-shadow
  22. ></xr-gltf>
  23. <xr-gltf
  24. wx:if="{{gltfId == 1}}"
  25. position="1 -0.98 -1" rotation="0 0 0"
  26. scale="0.015 0.015 0.015"
  27. model="gltf-{{gltfId}}"
  28. cast-shadow
  29. ></xr-gltf>
  30. </xr-node>
  31. </xr-node>
  32. <!-- Video -->
  33. <xr-node wx:if="{{videoLoaded}}">
  34. <xr-node
  35. wx:for="{{videoIdList}}" wx:for-item="videoId"
  36. wx:key="videoId"
  37. >
  38. <xr-mesh
  39. wx:if="{{videoId == 0}}"
  40. node-id="mesh-cube" position="-1 -0.5 1" scale="0.8 1.4 0.8"
  41. geometry="cube" material="video-mat-{{videoId}}"
  42. cast-shadow
  43. />
  44. </xr-node>
  45. </xr-node>
  46. <xr-camera
  47. id="camera" node-id="camera" position="0 2 4" clear-color="0.8 0.8 0.8 1"
  48. target="camera-target"
  49. camera-orbit-control=""
  50. ></xr-camera>
  51. </xr-node>
  52. <xr-node node-id="lights">
  53. <xr-light type="ambient" color="1 1 1" intensity="1" />
  54. <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="3" cast-shadow/>
  55. </xr-node>
  56. </xr-scene>