index.wxml 1.4 KB

123456789101112131415161718192021222324
  1. <xr-scene id="xr-scene" bind:ready="handleReady" bind:tick="handleTick">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load type="gltf" asset-id="gltf-door" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/door.glb" />
  4. <xr-asset-load type="gltf" asset-id="gltf-myModel" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/Xbot.glb" />
  5. </xr-assets>
  6. <xr-node>
  7. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  8. <!-- <xr-gltf id="door" node-id="door" position="0 0 0" rotation="0 0 0" scale="0.01 0.01 0.01" model="gltf-door"
  9. cube-shape="autoFit:true" shape-gizmo
  10. bind:gltf-loaded="handleGltfLoaded"
  11. sphere-shape="radius: 1.5"
  12. bind:anim-stop="handleAnimationStop"
  13. ></xr-gltf> -->
  14. <xr-gltf id="myModel" node-id="myModel" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-myModel" cube-shape="size: 0.5 2 0.5; center: 0 0.8 0" shape-gizmo bind:gltf-loaded="handleGltfLoaded" bind:touch-shape="handleTouchModel"></xr-gltf>
  15. <xr-camera id="camera" node-id="camera" position="0 3 4" clear-color="0.1 0.1 0.1 1" target="camera-target" camera-orbit-control=""></xr-camera>
  16. </xr-node>
  17. <xr-node node-id="lights">
  18. <xr-light type="ambient" color="1 1 1" intensity="1" />
  19. <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="3" cast-shadow />
  20. </xr-node>
  21. </xr-scene>