gemer hai 1 ano
pai
achega
97b31221ab

+ 28 - 1
miniprogram/components/ar-tracker/ar-tracker.js

@@ -115,6 +115,29 @@ Component({
             isStartPlay2: true
           })
         }
+        if (type === 3) {
+          console.warn('play 3')
+          if (this.animator3) {
+            if (!this.data.isStartPlay3) {
+              this.animator3.play('Group21137Action', {
+                loop: 0
+              });
+              this.animator3.play('polySurface1Action', {
+                loop: 0
+              });
+              this.animator3.play('vlAction', {
+                loop: 0
+              });
+            } else {
+              this.animator3.resume('Group21137Action')
+              this.animator3.resume('polySurface1Action')
+              this.animator3.resume('vlAction')
+            }
+          }
+          this.setData({
+            isStartPlay3: true
+          })
+        }
       }
 
     },
@@ -180,7 +203,11 @@ Component({
         state,
         errorMessage
       } = tracker;
-      if (state == 2) {}
+      if (state == 2) {
+        this.play(3);
+      } else {
+        this.pause(3);
+      }
     }
   }
 })

+ 8 - 2
miniprogram/components/ar-tracker/ar-tracker.wxml

@@ -21,11 +21,17 @@
       <xr-gltf model="item1" scale="5 5 5" rotation="270 0 0" bind:gltf-loaded="handleItem1Loaded"></xr-gltf>
     </xr-ar-tracker>
     <xr-ar-tracker id="ar-tracker-2" mode="Marker" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/marker.png" bind:ar-tracker-state="handleARTrackerState2">
-      <xr-gltf model="item2" scale="0.08 0.08 0.08" rotation="0 -90 90" bind:gltf-loaded="handleItem2Loaded"></xr-gltf>
+      <xr-gltf model="item2" position="0 0.2 0"  scale="0.08 0.08 0.08" rotation="0 -90 80" bind:gltf-loaded="handleItem2Loaded"></xr-gltf>
 
     </xr-ar-tracker>
     <xr-ar-tracker id="ar-tracker-3" mode="Marker" src="https://houseoss.4dkankan.com/mini-ar-test/AR/3/marker.png" bind:ar-tracker-state="handleARTrackerState3">
-      <xr-gltf model="item3" scale="5 5 5" rotation="270 0 0" bind:gltf-loaded="handleItem3Loaded"></xr-gltf>
+
+      <xr-node>
+        <xr-gltf id="item3" position="0 0 0" scale="0.05 0.05 0.05" rotation="-80 0 0" model="item3" bind:gltf-loaded="handleItem3Loaded" cast-shadow receive-shadow></xr-gltf>
+        <xr-light type="ambient" color="1 1 1" intensity="2" />
+        <xr-light type="directional" rotation="180 10 0" color="1 1 1" intensity="3" />
+      </xr-node>
+
     </xr-ar-tracker>
 
     <!-- <xr-camera id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1" far="2000" background="ar" is-ar-camera></xr-camera> -->