index.wxml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. <!-- Image -->
  33. <xr-node wx:if="{{imageLoaded}}">
  34. <xr-node
  35. wx:for="{{imageIdList}}" wx:for-item="imageId"
  36. wx:key="imageId"
  37. >
  38. <xr-mesh
  39. wx:if="{{imageId === 2}}"
  40. position="1 1 0" scale="1 1 0.2"
  41. geometry="cube" material="texture-mat-{{imageId}}"
  42. cast-shadow
  43. />
  44. <xr-mesh
  45. wx:if="{{imageId === 3}}"
  46. position="-1 1 0" scale="1 1 0.2"
  47. geometry="cube" material="texture-mat-{{imageId}}"
  48. cast-shadow
  49. />
  50. </xr-node>
  51. </xr-node>
  52. <!-- Video -->
  53. <xr-node wx:if="{{videoLoaded}}">
  54. <xr-node
  55. wx:for="{{videoIdList}}" wx:for-item="videoId"
  56. wx:key="videoId"
  57. >
  58. <xr-mesh
  59. wx:if="{{videoId === 4}}"
  60. node-id="mesh-cube" position="0 -0.5 1" scale="0.8 1.4 0.8"
  61. geometry="cube" material="video-mat-{{videoId}}"
  62. cast-shadow
  63. />
  64. <xr-mesh
  65. wx:if="{{videoId === 5}}"
  66. node-id="mesh-cube" position="-1.5 -0.6 1" scale="1.2 0.8 0.8"
  67. geometry="cube" material="video-mat-{{videoId}}"
  68. cast-shadow
  69. />
  70. <xr-mesh
  71. wx:if="{{videoId === 6}}"
  72. node-id="mesh-cube" position="1.5 -0.6 1" scale="1.2 0.8 0.8"
  73. geometry="cube" material="video-mat-{{videoId}}"
  74. cast-shadow
  75. />
  76. </xr-node>
  77. </xr-node>
  78. <xr-camera
  79. id="camera" node-id="camera" position="0 3 5" clear-color="0.8 0.8 0.8 1"
  80. target="camera-target"
  81. camera-orbit-control=""
  82. ></xr-camera>
  83. </xr-node>
  84. <xr-node node-id="lights">
  85. <xr-light type="ambient" color="1 1 1" intensity="1" />
  86. <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="3" cast-shadow/>
  87. </xr-node>
  88. </xr-scene>