index.wxml 1.4 KB

1234567891011121314151617181920212223242526
  1. <xr-scene id="xr-scene" bind:ready="handleReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load asset-id="gltf-anim" type="keyframe" src="/assets/animation/gltf-animation.json"/>
  4. <xr-asset-load type="gltf" asset-id="gltf-Sponza" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/Sponza/glTF/Sponza.gltf" />
  5. </xr-assets>
  6. <xr-node wx:if="{{loaded}}">
  7. <xr-node node-id="camera-target" position="0 2 0"></xr-node>
  8. <xr-gltf node-id="mesh-gltf-Sponza" position="0 -2 0.3" rotation="0 0 0" scale="2 2 2" model="gltf-Sponza"></xr-gltf>
  9. <xr-camera
  10. id="camera" node-id="camera" position="-1 2 0" clear-color="0.925 0.925 0.925 1"
  11. draw-sky target="camera-target" far="1000"
  12. camera-orbit-control=""
  13. ></xr-camera>
  14. </xr-node>
  15. <xr-node node-id="lights">
  16. <xr-light type="ambient" color="1 1 1" intensity="0.8" />
  17. <xr-light type="directional" rotation="120 -40 0" color="1 1 1" intensity="4" />
  18. <xr-light
  19. type="point" position="10 0 0" color="1 1 1" range="10" intensity="30"
  20. anim-keyframe="gltf-anim" anim-autoplay="clip:pointLight, speed:2"
  21. />
  22. <xr-light
  23. type="spot" color="0.8 0.8 0.2" position="10 4 -0.3" range="20" intensity="100" rotation="16 90 0" inner-cone-angle="5" outer-cone-angle="24"
  24. />
  25. </xr-node>
  26. </xr-scene>