gemercheung 1 年間 前
コミット
9c43b4f368

+ 12 - 31
miniprogram/components/ar-tracker/ar-tracker.js

@@ -14,7 +14,7 @@ Component({
     async detached() {
       console.error('detached')
       this.video1 && (this.video1 = null);
-      this.video12 && (this.video12 = null);
+      // this.video12 && (this.video12 = null);
       this.video2 && (this.video2 = null);
       this.animator1 && (this.animator1 = null);
       this.animator2 && (this.animator2 = null);
@@ -101,12 +101,12 @@ Component({
       console.warn('item1 load', el)
       const gltf = el.getComponent("gltf");
       const video = this.scene.assets.getAsset("video-texture", "item1-v");
-      const video12 = this.scene.assets.getAsset("video-texture", "item12-v");
+      // const video12 = this.scene.assets.getAsset("video-texture", "item12-v");
       const newMat = this.scene.assets.getAsset("material", "item1-m");
-      const newMat2 = this.scene.assets.getAsset("material", "item12-m");
+      // const newMat2 = this.scene.assets.getAsset("material", "item12-m");
 
       this.video1 = video
-      this.video12 = video12
+      // this.video12 = video12
       console.log('this.video1', this.video1)
       this.video1.onPlay = () => {
         console.warn('video1 playing')
@@ -121,7 +121,7 @@ Component({
         this.setData({
           isVideoEnd1: true
         })
-        this.video12 && this.video12.play();
+        // this.video12 && this.video12.play();
       }
       const animator = el.getComponent("animator");
       this.animator1 = animator
@@ -129,20 +129,7 @@ Component({
       console.warn('this.animator1', this.animator1)
       const othergltf = this.scene.assets.getAsset("gltf", "item1")
 
-      // console.error('meshes', gltf.meshes)
 
-      // mesh_video1_16978video1
-      //mesh_video2_16942video2
-
-      // console.log('1', gltf.getPrimitivesByMeshName('mesh_video1_16978video1'))
-      // console.log('2', gltf.getPrimitivesByMeshName('mesh_video2_16942video2'))
-
-
-      // console.error('othergltf', othergltf)
-      // for (const mesh of gltf.meshes) {
-      //   // mesh.material = newMat
-      //   console.warn('gltf-m', mesh)
-      // }
 
 
       for (const mesh of othergltf.model.meshes) {
@@ -155,21 +142,15 @@ Component({
             mesh.material = newMat
           }
         }
-        if (String(mesh.name).includes('video2')) {
-          const videoMesh2 = gltf.getPrimitivesByMeshName(mesh.name)
-          console.warn('videoMesh2', mesh.name, videoMesh2[0].nodeName)
-          for (const mesh of gltf.getPrimitivesByNodeName(videoMesh2[0].nodeName)) {
-            mesh.material = newMat2
-          }
-        }
+        // if (String(mesh.name).includes('video2')) {
+        //   const videoMesh2 = gltf.getPrimitivesByMeshName(mesh.name)
+        //   console.warn('videoMesh2', mesh.name, videoMesh2[0].nodeName)
+        //   for (const mesh of gltf.getPrimitivesByNodeName(videoMesh2[0].nodeName)) {
+        //     mesh.material = newMat2
+        //   }
+        // }
       }
 
-
-      // for (const mesh of gltf.getPrimitivesByNodeName('node_video2_-7072')) {
-      //   mesh.material = newMat2
-      //   // console.warn('mesh2', mesh)
-      // }
-
     },
     handleItem2Loaded({
       detail

+ 3 - 3
miniprogram/components/ar-tracker/ar-tracker.wxml

@@ -2,7 +2,7 @@
 
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
 
-    <xr-asset-load type="gltf" asset-id="item1" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/ddn04/ddn04.gltf" options="preserveRaw: true" />
+    <xr-asset-load type="gltf" asset-id="item1" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/dds01/dds01.gltf" options="preserveRaw: true" />
     <xr-asset-load type="gltf" asset-id="item2" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/gc99.glb" />
     <xr-asset-load type="gltf" asset-id="item3" src="https://houseoss.4dkankan.com/mini-ar-test/mtgj.glb" />
 
@@ -11,8 +11,8 @@
     <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="item1-m" effect="simple" uniforms="u_baseColorMap: video-item1-v" />
 
-    <xr-asset-load type="video-texture" asset-id="item12-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4" options="autoPlay:true,loop:true,abortAudio:true,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
-    <xr-asset-material asset-id="item12-m" effect="simple" uniforms="u_baseColorMap: video-item12-v" />
+    <!-- <xr-asset-load type="video-texture" asset-id="item12-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4" options="autoPlay:true,loop:true,abortAudio:true,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
+    <xr-asset-material asset-id="item12-m" effect="simple" uniforms="u_baseColorMap: video-item12-v" /> -->
 
 
     <xr-asset-load type="video-texture" asset-id="item2-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />

+ 1 - 1
project.config.json

@@ -35,5 +35,5 @@
     "ignore": [],
     "include": []
   },
-  "appid": "wxd55ee54235e90359"
+  "appid": "wx85269d0a44286ccf"
 }