Browse Source

把所有模型添加进来

胡佳骏 1 year ago
parent
commit
1c2fbe4a0e

+ 1 - 84
miniprogram/app.json

@@ -1,87 +1,6 @@
 {
   "pages": [
-    "pages/ar-classic/scene-classic-video/index",
-    "pages/index/index",
-    "pages/basic/scene-basic/index",
-    "pages/basic/scene-basic-alpha/index",
-    "pages/basic/scene-basic-light/index",
-    "pages/basic/scene-basic-animation/index",
-    "pages/basic/scene-basic-touch/index",
-    "pages/basic/scene-basic-visible-layer/index",
-    "pages/basic/scene-basic-shadow/index",
-    "pages/basic/scene-basic-video/index",
-    "pages/basic/scene-basic-render-texture/index",
-    "pages/basic/scene-basic-postprocessing/index",
-    "pages/basic/scene-basic-envData/index",
-    "pages/basic/scene-basic-share/index",
-    "pages/gltf/scene-gltf-damageHelmet/index",
-    "pages/gltf/scene-gltf-unlit/index",
-    "pages/gltf/scene-gltf-animation/index",
-    "pages/gltf/scene-gltf-morph/index",
-    "pages/gltf/scene-gltf-light-loading/index",
-    "pages/gltf/scene-gltf-specularGlossiness/index",
-    "pages/gltf/scene-gltf-sheen/index",
-    "pages/gltf/scene-gltf-transmission/index",
-    "pages/gltf/scene-gltf-textureTransform/index",
-    "pages/gltf/scene-gltf-lightsPunctual/index",
-    "pages/gltf/scene-gltf-compressTextures/index",
-    "pages/ar/scene-ar-basic/index",
-    "pages/ar/scene-ar-2dmarker/index",
-    "pages/ar/scene-ar-osdmarker/index",
-    "pages/ar/scene-ar-face/index",
-    "pages/ar/scene-ar-hand/index",
-    "pages/ar/scene-ar-body/index",
-    "pages/ar/scene-ar-threeDof/index",
-    "pages/ar/scene-ar-camera/index",
-    "pages/ar/scene-ar-vio-marker/index",
-    "pages/ar/scene-ar-vio-depth/index",
-    "pages/custom/scene-custom-logic/index",
-    "pages/custom/scene-custom-render/index",
-    "pages/scan/scene-scan-render/index",
-    "pages/scan/scene-scan-team/index",
-    "pages/ar-classic/scene-classic-wxball/index",
-    "pages/ar-classic/scene-classic-perspect/index",
-    "pages/ar-classic/scene-classic-portal/index",
-    "pages/ar-classic/scene-classic-osd/index",
-    "pages/ar-classic/scene-classic-face/index",
-    "pages/template/xr-template-message/index",
-    "pages/template/xr-template-control/index",
-    "pages/template/xr-template-loading/index",
-    "pages/template/xr-template-toon/index",
-    "pages/template/xr-template-planeShadow/index",
-    "pages/template/xr-template-geometry/index",
-    "pages/template/xr-template-gltfEdit/index",
-    "pages/template/xr-template-gltfAnimation/index",
-    "pages/template/xr-template-gltfOcclusion/index",
-    "pages/template/xr-template-gltfUVAnimation/index",
-    "pages/template/xr-template-blendDouble/index",
-    "pages/template/xr-template-frameEffect/index",
-    "pages/template/xr-template-tracker/index",
-    "pages/template/xr-template-markerCenter/index",
-    "pages/template/xr-template-markerLock/index",
-    "pages/template/xr-template-arLine/index",
-    "pages/template/xr-template-select/index",
-    "pages/template/xr-template-share/index",
-    "pages/template/xr-template-removeBlack/index",
-    "pages/template/xr-template-featherVideo/index",
-    "pages/template/xr-template-arPreview/index",
-    "pages/template/xr-template-lookat/index",
-    "pages/template/xr-template-arui/index",
-    "pages/scene-last-record/index",
-    "pages/scene-beside-edge/index",
-    "pages/physics/scene-physics-shoot/index",
-    "pages/physics/scene-physics-throw/index",
-    "pages/particle/scene-particle-firework/index",
-    "pages/particle/scene-particle-portal/index",
-    "pages/particle/scene-particle-orb/index",
-    "pages/particle/scene-particle-shapeEmitter/index",
-    "pages/particle/scene-particle-custom/index",
-    "pages/particle/scene-particle-meshEmitter/index",
-    "pages/customParticle/scene-customParticle-firework/index",
-    "pages/customParticle/scene-customParticle-orb/index",
-    "pages/customParticle/scene-customParticle-portal/index",
-    "pages/customParticle/scene-customParticle-shapeEmitter/index",
-    "pages/customParticle/scene-customParticle-meshEmitter/index"
+    "pages/ar-classic/scene-classic-video/index"
   ],
   "usingComponents": {},
   "window": {
@@ -90,7 +9,5 @@
     "navigationBarTitleText": "",
     "navigationBarTextStyle": "black"
   },
-  "style": "v2",
-  "sitemapLocation": "sitemap.json",
   "lazyCodeLoading": "requiredComponents"
 }

+ 17 - 17
miniprogram/components/xr-classic-video/index.js

@@ -24,34 +24,38 @@ Component({
         loaded: true
       });
     },handleGltfLoaded: function() {
+ 
       const xrScene = this.scene;
 
       const xrFrameSystem = wx.getXrFrameSystem();
-
+      
       this.wxball = xrScene.getElementById('wxball');
 
       this.wxballTransform = this.wxball.getComponent(xrFrameSystem.Transform);
-      
       this.wxballAnimator = this.wxball.getComponent(xrFrameSystem.Animator);
 
       this.wxballAnimator.play('gltfAnimation', {
-        loop: 0,
+        loop: -1,
       });
 
       this.wxballAnimator.play('gltfAnimation#0', {
-        loop: 0,
+        loop: -1,
       });
-
-      this.wxballAnimator.pauseToFrame('gltfAnimation', 1);
-      this.wxballAnimator.pauseToFrame('gltfAnimation#0', 1);
-
-     this.wxballTransform.visible = true;
-
+      this.wxballTransform.visible = true;
     },
     handleTrackerSwitch: function ({detail}) {
       const active = detail.value;
       console.log('handleTrackerSwitch', detail);
 
+      this.wxballAnimator = this.wxball.getComponent(xrFrameSystem.Animator);
+
+      this.wxballAnimator.play('gltfAnimation', {
+        loop: -1,
+      });
+
+      this.wxballAnimator.play('gltfAnimation#0', {
+        loop: -1,
+      });
       
      // const video = this.scene.assets.getAsset('video-texture', 'hikari');
       if (active) {
@@ -61,13 +65,9 @@ Component({
      //   video.stop();
         this.wxballTransform.visible = false;
       }
-      this.animationRuning = true;
-
-      this.wxballAnimator.pauseToFrame('gltfAnimation', 1);
-      this.wxballAnimator.pauseToFrame('gltfAnimation#0', 1);
-      
-      this.wxballAnimator.resume('gltfAnimation');
-      this.wxballAnimator.resume('gltfAnimation#0');
+    },
+    handleAnimationStop: function() {
+      console.log('animation Stop');
     }
   }
 })

+ 52 - 25
miniprogram/components/xr-classic-video/index.wxml

@@ -2,47 +2,74 @@
   
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
 
-    <xr-asset-load type="gltf" asset-id="gltf-wxball" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/1.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-wxball2" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/2.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-wxball3" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/3.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-wxball4" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/4.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-wxball5" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/5.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-wxball6" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/6.glb" />
+    <xr-asset-load type="env-data" asset-id="env1" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/env-test.bin" />
+
+    <xr-asset-load type="gltf" asset-id="gltf-long" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/1.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-yanhua" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/4.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-binglong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/3.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-lanjiachong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/5.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-huangfeilong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/6.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-lanniao" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/7.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-denglong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/8.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-heiguaishou" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/9.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-lvfeilong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/10.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-jingyu" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/12.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-baiseniu" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/13.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-baiseniu2" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/14.glb" />
   </xr-assets>
+  <xr-env env-data="env1"/>
   <xr-node wx:if="{{loaded}}">
     <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/1.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.001 0.001 0.001" position="0 -1.5 0" model="gltf-long"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
-    </xr-ar-tracker>
-    
-    <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/2.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball2"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="1 -1 0" model="gltf-yanhua"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
-    </xr-ar-tracker>
-    <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/3.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball3"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="1 1 1" position="-1 0 0" model="gltf-binglong"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
-    </xr-ar-tracker>
-    <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/4.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball4"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="30 30 30" position="-1 0 -1" model="gltf-lanjiachong"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
-    </xr-ar-tracker>
-    <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/5.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball5"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="30 30 30" position="0 0 -1" model="gltf-huangfeilong"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
-    </xr-ar-tracker>
-    <xr-ar-tracker mode="Marker" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/6.jpg" bind:ar-tracker-switch="handleTrackerSwitch">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 0 0" rotation="0 0 0" scale="1 1 1" model="gltf-wxball6"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="1 1 1" position="1 0 -1" model="gltf-lanniao"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="200 200 200" position="1 0 1" model="gltf-denglong"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="3 3 3" position="0 0 1" model="gltf-heiguaishou"
         bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.003 0.003 0.003" position="-1 0 1" model="gltf-lvfeilong"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.03 0.03 0.03" position="-2 0 0" model="gltf-jingyu"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.005 0.005 0.005"position="2 0 0" model="gltf-baiseniu"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
+      />
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="1 1 1"position="0 0 -2" model="gltf-baiseniu2"
+        bind:gltf-loaded="handleGltfLoaded"
+        anim-autoplay
       />
     </xr-ar-tracker>
-
-
+    
     <xr-camera
       id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
       background="ar" is-ar-camera

+ 2 - 5
miniprogram/components/xr-classic-wxball/index.js

@@ -54,16 +54,13 @@ Component({
       this.wxballAnimator = this.wxball.getComponent(xrFrameSystem.Animator);
 
       this.wxballAnimator.play('gltfAnimation', {
-        loop: 0,
+        loop: -1,
       });
 
       this.wxballAnimator.play('gltfAnimation#0', {
-        loop: 0,
+        loop: -1,
       });
 
-      this.wxballAnimator.pauseToFrame('gltfAnimation', 1);
-      this.wxballAnimator.pauseToFrame('gltfAnimation#0', 1);
-
       this.wxballTransform.visible = true;
 
     },

+ 1 - 1
miniprogram/components/xr-classic-wxball/index.wxml

@@ -6,7 +6,7 @@
   <xr-env env-data="env1"/>
   <xr-node>
     <xr-ar-tracker mode="OSD" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/wxball.jpg">
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" position="0 -0.1 0" rotation="-45 30 0" scale="0.16 0.16 0.16" model="gltf-wxball"
+      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.16 0.16 0.16" model="gltf-wxball"
         bind:gltf-loaded="handleGltfLoaded"
         bind:touch-shape="handleTouchWXball" sphere-shape="radius: 1.5"
         bind:anim-stop="handleAnimationStop"

+ 1 - 1
miniprogram/components/xr-gltf-animation/index.wxml

@@ -3,7 +3,7 @@
     <xr-asset-load asset-id="anim" type="keyframe" src="/assets/animation/miku-kawaii-animation.json"/>
     <xr-asset-load type="gltf" asset-id="cloud-station" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/cloud-station/index.glb" />
     <xr-asset-load type="gltf" asset-id="miku-kawaii" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/shiteyanyo-hatsune-miku/index.glb" />
-    <xr-asset-load type="gltf" asset-id="miku" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/miku.glb" />
+    <xr-asset-load type="gltf" asset-id="miku" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/whale.glb" />
   </xr-assets>
   <xr-node>
     <xr-node node-id="target" position="0 1 0" />

+ 1 - 1
miniprogram/pages/ar-classic/scene-classic-video/index.wxml

@@ -5,7 +5,7 @@
     id="main-frame"
     width="{{renderWidth}}"
     height="{{renderHeight}}"
-    style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;"
+    style="width:150%;height:100%;display:block;"
     markerImg="{{markerImg}}"
     bind:arTrackerState="handleARTrackerState"
   />