index.wxml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <xr-scene ar-system="modes:OSD" id="xr-scene" bind:ready="handleReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-material asset-id="simple" effect="simple" />
  4. <xr-asset-material asset-id="text-simple" effect="simple" />
  5. </xr-assets>
  6. <xr-node>
  7. <xr-ar-tracker mode="OSD" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/marker/osdmarker-test.jpg" bind:ar-tracker-switch="handleToySwitch">
  8. <xr-node wx:if="{{toyReady}}" rotation="0 180 0">
  9. <xr-mesh node-id="text-wrap" position="0.9 0.4 0" rotation="90 0 0" scale="0.8 1 0.2" geometry="plane" material="simple"
  10. uniforms="u_baseColorFactor: 0.2 0.6 0.4 0.95"
  11. states="alphaMode: BLEND"
  12. ></xr-mesh>
  13. <xr-mesh node-id="text-wrap-sub" position="0.9 0.1 0" rotation="90 0 0" scale="0.8 1 0.4" geometry="plane" material="simple"
  14. uniforms="u_baseColorFactor: 0 0 0 0.95"
  15. states="alphaMode: BLEND"
  16. ></xr-mesh>
  17. <!-- 文本处于beta版本,功能不完备,仅支持使用独立材质的基础渲染,不能更新渲染(修复中) -->
  18. <xr-text node-id="text-name" position="0.7 0.36 0.01" scale="0.1 0.1 1" material="text-simple"
  19. value="牛年公仔"
  20. ></xr-text>
  21. <xr-text node-id="text-name" position="0.6 0.16 0.01" scale="0.06 0.06 1" material="text-simple"
  22. value="牛年发布的奶牛公仔"
  23. ></xr-text>
  24. <xr-text node-id="text-name" position="0.6 0.06 0.01" scale="0.06 0.06 1" material="text-simple"
  25. value="礼盒中还包含玩具盲盒"
  26. ></xr-text>
  27. </xr-node>
  28. </xr-ar-tracker>
  29. <xr-ar-tracker mode="OSD" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/gz-tower/day.jpg" bind:ar-tracker-switch="handleDaySwitch">
  30. <xr-node wx:if="{{gzDayReady}}" rotation="0 180 0" >
  31. <xr-mesh node-id="text-wrap" position="1 0.4 0" rotation="90 0 0" scale="1 1 0.2" geometry="plane" material="simple"
  32. uniforms="u_baseColorFactor: 0.2 0.6 0.4 0.95"
  33. states="alphaMode: BLEND"
  34. ></xr-mesh>
  35. <xr-mesh node-id="text-wrap-sub" position="1 0.1 0" rotation="90 0 0" scale="1 1 0.4" geometry="plane" material="simple"
  36. uniforms="u_baseColorFactor: 0 0 0 0.95"
  37. states="alphaMode: BLEND"
  38. ></xr-mesh>
  39. <!-- 文本处于beta版本,功能不完备,仅支持使用独立材质的基础渲染,不能更新渲染(修复中) -->
  40. <xr-text node-id="text-name" position="0.85 0.36 0.01" scale="0.1 0.1 1" material="text-simple"
  41. value="广州塔"
  42. ></xr-text>
  43. <xr-text node-id="text-name" position="0.6 0.18 0.01" scale="0.05 0.05 1" material="text-simple"
  44. value="广州塔(英语:Canton Tower)"
  45. ></xr-text>
  46. <xr-text node-id="text-name" position="0.6 0.08 0.01" scale="0.05 0.05 1" material="text-simple"
  47. value="又称广州新电视塔,昵称小蛮腰"
  48. ></xr-text>
  49. <xr-text node-id="text-name" position="0.6 -0.02 0.01" scale="0.05 0.05 1" material="text-simple"
  50. value="海拔高程600米,距离珠江南岸125米"
  51. ></xr-text>
  52. </xr-node>
  53. </xr-ar-tracker>
  54. <xr-camera
  55. id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
  56. far="2000" background="ar" is-ar-camera
  57. ></xr-camera>
  58. </xr-node>
  59. <xr-node node-id="lights">
  60. <xr-light type="ambient" color="1 1 1" intensity="0.3" />
  61. <xr-light type="directional" rotation="30 60 0" color="1 1 1" intensity="1" />
  62. </xr-node>
  63. </xr-scene>