index.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. <xr-scene id="xr-scene" bind:ready="handleReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load
  4. type="video-texture" asset-id="cat"
  5. src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/cat.mp4" options="autoPlay:true,loop:true,abortAudio:false,placeHolder:https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/cat.jpg"
  6. />
  7. <xr-asset-load
  8. type="video-texture" asset-id="skybox"
  9. src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/office-skybox.mp4" options="autoPlay:true,loop:true,placeHolder:https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/office-skybox.jpg"
  10. />
  11. <xr-asset-material asset-id="standard-mat" effect="standard" />
  12. </xr-assets>
  13. <xr-env sky-map="video-skybox" />
  14. <xr-node>
  15. <xr-node node-id="target" />
  16. <xr-mesh
  17. node-id="mesh-cube" scale="1.6 0.9 0.9"
  18. geometry="cube" material="standard-mat"
  19. uniforms="u_baseColorMap:video-cat"
  20. cube-shape="autoFit:true"
  21. bind:touch-shape="handleTouchCube"
  22. />
  23. <xr-camera
  24. id="camera" node-id="camera" position="0 0 3" clear-color="0.925 0.925 0.925 1"
  25. target="target" background="skybox" camera-orbit-control=""
  26. ></xr-camera>
  27. </xr-node>
  28. <xr-node node-id="lights">
  29. <xr-light type="ambient" color="1 1 1" intensity="1" />
  30. <xr-light type="directional" rotation="40 0 0" color="1 1 1" intensity="3"/>
  31. </xr-node>
  32. </xr-scene>