index.wxml 1.5 KB

1234567891011121314151617181920212223242526272829
  1. <xr-scene id="xr-scene">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load type="env-data" asset-id="sunSet" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/env-test.bin"/>
  4. </xr-assets>
  5. <xr-env env-data="xr-frame-team-workspace-day"/>
  6. <xr-node wx:if="{{loaded}}">
  7. <xr-node node-id="center" position="0 0 0"></xr-node>
  8. <!-- 基础反光小球 -->
  9. <xr-mesh node-id="basic-roughness" position="-1.1 0 -1.1" geometry="sphere" uniforms="u_metallicRoughnessValues: 0 0"></xr-mesh>
  10. <xr-mesh node-id="basic-metal" position="1.1 0 -1.1" geometry="sphere" uniforms="u_metallicRoughnessValues: 1 0"></xr-mesh>
  11. <!-- 使用环境数据需要保证资源已经加载完 -->
  12. <xr-mesh node-id="sunSet-roughness" env-data="sunSet" position="-1.1 0 1.1" scale="1 1 1" geometry="sphere" uniforms="u_metallicRoughnessValues: 0 0"></xr-mesh>
  13. <xr-mesh node-id="sunSet-metal" env-data="sunSet" position="1.1 0 1.1" scale="1 1 1" geometry="sphere" uniforms="u_metallicRoughnessValues: 1 0"></xr-mesh>
  14. <xr-camera
  15. id="camera" node-id="camera" position="4 4 4" clear-color="0.1 0.1 0.1 1"
  16. target="center" near="0.1" far="2000" background="skybox"
  17. camera-orbit-control=""
  18. ></xr-camera>
  19. </xr-node>
  20. <xr-node node-id="lights">
  21. <xr-light type="ambient" color="1 1 1" intensity="0.3" />
  22. <xr-light type="directional" rotation="20 120 0" color="1 1 1" intensity="1" />
  23. </xr-node>
  24. </xr-scene>