index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
  2. var handleDecodedXML = require('../../behavior-scene/util').handleDecodedXML;
  3. var xmlCode = `<xr-scene ar-system="modes:Plane" id="xr-scene" bind:ready="handleReady" bind:arReady="handleARReady" bind:log="handleLog">
  4. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  5. <xr-asset-load type="gltf" asset-id="gltf-item" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/just_a_girl/scene.gltf" />
  6. <xr-asset-material asset-id="standard-mat" effect="standard" />
  7. </xr-assets>
  8. <xr-node>
  9. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  10. <xr-ar-tracker mode="Plane">
  11. <xr-node>
  12. <xr-mesh id="ar-tracker-mesh" geometry="cube" scale="0.5 0.05 0.5" material="standard" />
  13. </xr-node>
  14. </xr-ar-tracker>
  15. <xr-node node-id="setitem">
  16. <xr-gltf model="gltf-item" scale="0.006 0.006 0.006"></xr-gltf>
  17. </xr-node>
  18. <xr-camera
  19. id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
  20. target="camera-target" background="ar" is-ar-camera
  21. camera-orbit-control
  22. ></xr-camera>
  23. </xr-node>
  24. <xr-node node-id="lights">
  25. <xr-light type="ambient" color="1 1 1" intensity="1" />
  26. <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
  27. </xr-node>
  28. </xr-scene>
  29. `;
  30. Page({
  31. behaviors:[sceneReadyBehavior],
  32. data: {
  33. xmlCode: '<div class="codeWrap">' + handleDecodedXML(xmlCode) + '</div>',
  34. }
  35. });