index.wxml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <xr-scene ar-system="modes:Plane" id="xr-scene" bind:ready="handleReady" bind:ar-ready="handleARReady" bind:pause="handlePause" bind:resume="handleResume">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load type="raw" asset-id="records" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-record.json" options="encoding:utf-8" />
  4. <xr-asset-load type="raw" asset-id="note" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-note.txt" options="encoding:utf-8" />
  5. <xr-asset-load asset-id="anchor" type="keyframe" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-record-anchor-animation.json"/>
  6. <xr-asset-load type="gltf" asset-id="loading" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/loading.glb" />
  7. <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
  8. <xr-asset-load type="gltf" asset-id="butterfly" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
  9. <xr-asset-load type="gltf" asset-id="sky" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/sky.gltf" />
  10. <xr-asset-load type="gltf" asset-id="office" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-record-unlit.glb" />
  11. <xr-asset-load type="gltf" asset-id="hikari" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/hikari-unlit.glb" />
  12. <xr-asset-load type="gltf" asset-id="roam" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/roam-unlit.glb" />
  13. <xr-asset-load type="gltf" asset-id="xinyi" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/xinyi-unlit.glb" />
  14. <xr-asset-load type="texture" asset-id="particle-point" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/particles/point.png" />
  15. </xr-assets>
  16. <xr-node layer="1">
  17. <xr-ar-tracker wx:if="{{loaded && !placed}}" mode="Plane" visible="false">
  18. <xr-node node-id="anchor" anim-keyframe="anchor" anim-autoplay="clip:parent">
  19. <xr-gltf model="anchor" />
  20. <xr-particle
  21. position="0 0.8 0"
  22. cube-shape="size:0.8 1.6 0.8" bind:touch-shape="handleShowDoor"
  23. capacity="4000" emit-rate="20"
  24. size="0.01 0.03" life-time="2.5 5" speed="0.2 0.4"
  25. start-color="1 1 1 1" end-color="1 1 1 0.5"
  26. emitter-type="BoxShape"
  27. emitter-props="minEmitBox:-0.15 -0.8 -0.15,maxEmitBox:0.15 -0.6 0.15,direction:0 1 0,direction2:0 1 0"
  28. atlas="numbers" atlas-frames="0 1" atlas-speed="4" atlas-random
  29. />
  30. </xr-node>
  31. </xr-ar-tracker>
  32. <xr-node id="setitem" node-id="setitem" visible="false">
  33. <xr-gltf
  34. id="sky" model="sky"
  35. states="cullOn: false, stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  36. />
  37. <xr-gltf
  38. id="scene-mesh" model="office"
  39. states="stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  40. />
  41. <xr-gltf id="hikari"
  42. position="-0.192 0.073 -5.403" rotation="0 106 0" model="hikari"
  43. anim-autoplay="clip:Sitting" capsule-shape="height:1;raduis:0.2;center:0 0.7 0"
  44. states="stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  45. bind:touch-shape="handleTouchObj"
  46. />
  47. <xr-gltf id="roam"
  48. position="-2.404 0.015 -5.152" rotation="0 -84 0" model="roam"
  49. anim-autoplay="clip:Sitting" capsule-shape="height:1;raduis:0.2;center:0 0.7 0"
  50. states="stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  51. bind:touch-shape="handleTouchObj"
  52. />
  53. <xr-gltf id="xinyi"
  54. position="-0.883 0.089 -7.118" rotation="0 -60 0" model="xinyi"
  55. anim-autoplay="clip:Sitting" capsule-shape="height:1;raduis:0.2;center:0 0.7 0"
  56. states="stencilComp: 3, stencilRef: 1, stencilReadMask: 1"
  57. bind:touch-shape="handleTouchObj"
  58. />
  59. <xr-node
  60. id="hikari-keyboard" position="-0.865 0.775 -5.276" rotation="0 9 0"
  61. cube-shape="size:0.3 0.05 0.4" bind:touch-shape="handleTouchObj"
  62. />
  63. <xr-node
  64. id="hikari-telephone" position="-1.103 0.809 -4.786" rotation="0 0 0"
  65. cube-shape="size:0.07 0.16 0.2" bind:touch-shape="handleTouchObj"
  66. />
  67. <xr-node
  68. id="hikari-qq" position="-1.14 1.344 -5.195" rotation="0 0 0"
  69. cube-shape="size:0.1 0.2 0.2" bind:touch-shape="handleTouchObj"
  70. />
  71. <xr-node
  72. id="hikari-cap" position="-0.493 0.786 -4.598" rotation="0 56 0"
  73. cube-shape="size:0.3 0.05 0.15" bind:touch-shape="handleTouchObj"
  74. />
  75. <xr-node
  76. id="hikari-calendar" position="-0.798 0.8 -4.674" rotation="0 111 0"
  77. cube-shape="size:0.2 0.05 0.1" bind:touch-shape="handleTouchObj"
  78. />
  79. <xr-node
  80. id="hikari-drinks" position="-0.617 0.795 -4.749" rotation="0 52 0"
  81. cube-shape="size:0.15 0.1 0.1" bind:touch-shape="handleTouchObj"
  82. />
  83. <xr-node
  84. id="chair" position="-0.413 0.638 -4.054" rotation="0 3 0"
  85. cube-shape="size:0.4 0.5 0.3" bind:touch-shape="handleTouchObj"
  86. />
  87. <xr-node
  88. id="hikari-earphone" position="-0.892 0.752 -4.934" rotation="0 10 0"
  89. cube-shape="size:0.1 0.03 0.1" bind:touch-shape="handleTouchObj"
  90. />
  91. <xr-node
  92. id="roam-pc" position="-1.69 0.805 -5.272" rotation="0 6 0"
  93. cube-shape="size:0.2 0.05 0.3" bind:touch-shape="handleTouchObj"
  94. />
  95. <xr-node
  96. id="roam-monitor" position="-1.577 1.085 -4.565" rotation="0 143 0"
  97. cube-shape="size:0.05 0.4 0.5" bind:touch-shape="handleTouchObj"
  98. />
  99. <xr-node
  100. id="xinyi-desktop" position="-0.181 0.787 -7.306" rotation="0 10 0"
  101. cube-shape="size:0.33 0.06 0.67" bind:touch-shape="handleTouchObj"
  102. />
  103. <xr-node
  104. id="xinyi-plant" position="0.164 0.896 -7.923" rotation="0 10 0"
  105. cube-shape="size:0.33 0.3 0.3" bind:touch-shape="handleTouchObj"
  106. />
  107. <xr-node
  108. id="xinyi-plant" position="0.164 0.896 -7.923" rotation="0 10 0"
  109. cube-shape="size:0.33 0.3 0.3" bind:touch-shape="handleTouchObj"
  110. />
  111. <xr-node
  112. id="xinyi-box" position="-0.254 0.282 -8.048" rotation="0 0 0"
  113. cube-shape="size:0.5 0.5 0.5" bind:touch-shape="handleTouchObj"
  114. />
  115. <xr-node
  116. id="disorder-desktop" position="-1.181 0.906 -4.05" rotation="0 272 0"
  117. cube-shape="size:0.5 0.3 0.65" bind:touch-shape="handleTouchObj"
  118. />
  119. <xr-node
  120. id="fan" position="-2.179 0.459 -4.022" rotation="0 272 0"
  121. cube-shape="size:0.3 1 0.3" bind:touch-shape="handleTouchObj"
  122. />
  123. <xr-node
  124. id="face-mask" position="-4.124 0.795 -4.512" rotation="0 286 0"
  125. cube-shape="size:0.2 0.05 0.3" bind:touch-shape="handleTouchObj"
  126. />
  127. <xr-node
  128. id="oscilloscope" position="-1.729 0.875 -4.084" rotation="0 25 0"
  129. cube-shape="size:0.3 0.3 0.2" bind:touch-shape="handleTouchObj"
  130. />
  131. <xr-node
  132. id="vege-dog" position="-1.872 0.833 -4.227" rotation="0 26 0"
  133. cube-shape="size:0.4 0.2 0.2" bind:touch-shape="handleTouchObj"
  134. />
  135. <xr-node
  136. id="trash" position="-3.164 0.405 -3.856" rotation="0 0 0"
  137. cube-shape="size:0.3 0.63 0.55" bind:touch-shape="handleTouchObj"
  138. />
  139. <xr-node
  140. id="light-monitor" position="-2.682 0.984 -7.266" rotation="0 0 0"
  141. cube-shape="size:0.1 0.28 0.55" bind:touch-shape="handleTouchObj"
  142. />
  143. <xr-node
  144. id="charge-pal" position="-2.438 0.181 -7.887" rotation="0 0 0"
  145. cube-shape="size:0.2 0.28 0.3" bind:touch-shape="handleTouchObj"
  146. />
  147. <xr-node
  148. id="note" position="-0.719 0.747 -5.008" rotation="0 16 0"
  149. cube-shape="size:0.22 0.04 0.15" bind:touch-shape="handleTouchNote"
  150. />
  151. <xr-node wx:if="{{gateClosed}}">
  152. <xr-particle
  153. material="particle-mat" position="-2.2 0.2 -5"
  154. capacity="2000" emit-rate="40" never-cull
  155. size="0.06 0.12" life-time="15 20" speed="0.2 0.4"
  156. start-color="1 1 1 1" end-color="1 1 1 0.4"
  157. emitter-type="BoxShape"
  158. emitter-props="minEmitBox:-20 0 -20,maxEmitBox:20 0 20,direction:0 1 0,direction2:0 1 0"
  159. texture="particle-point"
  160. />
  161. <xr-node
  162. id="oberon" position="0 1.4 1" rotation="0 0 0"
  163. sphere-shape="radius:0.3" bind:touch-shape="handleTouchObj"
  164. >
  165. <xr-particle
  166. capacity="1000" emit-rate="80" never-cull
  167. size="0.02 0.03" life-time="1.5 2" speed="0.04 0.08"
  168. start-color="0.5 0.9 0.7 1" end-color="0.5 0.9 0.7 0.4"
  169. emitter-type="SphereShape"
  170. emitter-props="radius:0.05,randomizeDirection:0"
  171. texture="particle-point"
  172. />
  173. </xr-node>
  174. <xr-node
  175. id="noname" position="-1 1.4 1" rotation="0 0 0"
  176. sphere-shape="radius:0.3" bind:touch-shape="handleTouchObj"
  177. >
  178. <xr-particle
  179. capacity="1000" emit-rate="80" never-cull
  180. size="0.02 0.03" life-time="1.5 2" speed="0.04 0.08"
  181. start-color="0.5 0.7 0.9 1" end-color="0.5 0.7 0.9 0.4"
  182. emitter-type="SphereShape"
  183. emitter-props="radius:0.05,randomizeDirection:0"
  184. texture="particle-point"
  185. />
  186. </xr-node>
  187. </xr-node>
  188. <xr-node
  189. wx:if="{{placed && !gateClosed}}" id="door" position="0 1 0" scale="0 0 0"
  190. >
  191. <xr-mesh
  192. id="door-mesh" rotation="90 0 0" scale="0.8 1 1.6"
  193. geometry="plane"
  194. states="renderQueue: 1, stencilComp: 7, stencilRef: 1, stencilReadMask: 1, stencilWriteMask: 1, stencilPass: 1, stencilFail: 2, stencilZFail: 2"
  195. />
  196. </xr-node>
  197. </xr-node>
  198. <xr-element wx:if="{{!gateClosed}}">
  199. <xr-asset-render-texture asset-id="ar-camera" width="{{width}}" height="{{height}}" />
  200. <xr-asset-render-texture asset-id="main-camera" width="{{width}}" height="{{height}}" />
  201. <xr-asset-post-process asset-id="blur" type="blur" data="radius:0" />
  202. <xr-asset-post-process
  203. asset-id="vignette" type="vignette"
  204. data="intensity:0,smoothness:2,color:0.1 0.1 0.1 1"
  205. />
  206. <xr-camera
  207. id="ar-bg-camera" cull-mask="0" depth="0"
  208. background="ar" post-process="blur vignette"
  209. render-target="ar-camera"
  210. />
  211. <xr-asset-material asset-id="final" effect="last-record-final" uniforms="u_arBg:render-ar-camera,u_main:render-main-camera" />
  212. <xr-mesh node-id="final" layer="2" geometry="ar-camera-plane" material="final" position="0 0 2" />
  213. <xr-camera
  214. id="final-camera" cull-mask="0b101" depth="2"
  215. target="final" is-clear-color="false"
  216. />
  217. </xr-element>
  218. <xr-asset-post-process asset-id="bloom" type="bloom" is-hdr data="radius:32,intensity:2,threshold:0.7" />
  219. <xr-asset-post-process asset-id="tone" type="tone" />
  220. <xr-camera
  221. id="main-camera" near="0.1" far="2000" cull-mask="0b11" depth="1"
  222. is-ar-camera clear-color="0 0 0 0" post-process="bloom tone"
  223. render-target="main-camera"
  224. >
  225. <xr-gltf wx:if="{{arReady && !loaded}}" position="0 0 10" model="loading" anim-autoplay />
  226. </xr-camera>
  227. </xr-node>
  228. <xr-node node-id="lights">
  229. <xr-light type="ambient" color="1 1 1" intensity="2" />
  230. </xr-node>
  231. </xr-scene>