index.js 1.5 KB

12345678910111213141516171819202122232425262728
  1. var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
  2. var handleDecodedXML = require('../../behavior-scene/util').handleDecodedXML;
  3. var xmlCode = `<xr-scene id="xr-scene">
  4. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  5. <xr-asset-load type="gltf" asset-id="gltf-just_a_girl" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/just_a_girl/scene.gltf" />
  6. </xr-assets>
  7. <xr-node>
  8. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  9. <xr-gltf node-id="gltf-just_a_girl" position="0 -0.5 0" rotation="0 0 0" scale="0.01 0.01 0.01" model="gltf-just_a_girl"></xr-gltf>
  10. <xr-camera
  11. id="camera" node-id="camera" position="0 0.4 1.6" clear-color="0.9 0.9 0.9 1"
  12. target="camera-target"
  13. camera-orbit-control=""
  14. ></xr-camera>
  15. </xr-node>
  16. <xr-node node-id="lights">
  17. <xr-light type="ambient" color="1 1 1" intensity="0.3" />
  18. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="2" />
  19. </xr-node>
  20. </xr-scene>
  21. `;
  22. Page({
  23. behaviors:[sceneReadyBehavior],
  24. data: {
  25. xmlCode: '<div class="codeWrap">' + handleDecodedXML(xmlCode) + '</div>',
  26. }
  27. });