MatteoScript commited on
Commit
f03556a
·
verified ·
1 Parent(s): 686dc6f

Update ar.html

Browse files
Files changed (1) hide show
  1. ar.html +37 -8
ar.html CHANGED
@@ -57,7 +57,7 @@
57
  padding: 0 !important;
58
  }
59
 
60
- .a-scene {
61
  position: fixed !important;
62
  top: 0 !important;
63
  left: 0 !important;
@@ -228,12 +228,12 @@
228
  <p class="text-white/60 text-xs mt-3 text-center">Il marker non è stato trovato. Usa questo player manuale.</p>
229
  </div>
230
 
231
- <!-- 5. AR SCENE - ULTRA STABILIZED -->
232
- <!-- filterBeta: 500 = smoothing MASSIMO, missTolerance: 50 = mantiene lock per 1.5+ sec -->
233
  <a-scene
234
- mindar-image="imageTargetSrc: img/targets.mind; filterMinCF:0.000001; filterBeta: 500; uiLoading: no; uiScanning: no; missTolerance: 50; warmupTolerance: 1"
235
  color-space="sRGB"
236
- renderer="colorManagement: true, physicallyCorrectLights, highRefreshRate: true"
237
  vr-mode-ui="enabled: false"
238
  device-orientation-permission-ui="enabled: false">
239
 
@@ -244,11 +244,12 @@
244
  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
245
 
246
  <a-entity id="example-target" mindar-image-target="targetIndex: 0">
247
- <!-- VIDEO 16:9 -->
248
  <a-entity id="myVid"
249
  geometry="primitive: plane; width: 1.6; height: 0.9"
250
  material="src: #vid; shader: flat; transparent: true; opacity: 1"
251
- position="0 0 0">
 
252
  </a-entity>
253
 
254
  <!-- Cornice Cyberpunk 16:9 -->
@@ -264,7 +265,7 @@
264
  <a-plane position="-0.77 0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
265
  <a-plane position="0.77 -0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
266
 
267
- <a-text value="HACK_THE_PLANET.exe" color="#00ff41" align="center" width="1.5" position="0 -0.6 0.01"
268
  font="https://cdn.aframe.io/fonts/Roboto-msdf.json">
269
  <a-animation attribute="opacity" from="0.3" to="1" dur="800" direction="alternate" repeat="indefinite"></a-animation>
270
  </a-text>
@@ -291,6 +292,34 @@
291
 
292
  let isAudioEnabled = false;
293
  let loadProgress = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
 
295
  // Easter Egg 1: Fake FPS Counter
296
  setInterval(() => {
 
57
  padding: 0 !important;
58
  }
59
 
60
+ a-scene {
61
  position: fixed !important;
62
  top: 0 !important;
63
  left: 0 !important;
 
228
  <p class="text-white/60 text-xs mt-3 text-center">Il marker non è stato trovato. Usa questo player manuale.</p>
229
  </div>
230
 
231
+ <!-- 5. AR SCENE - ULTRA MEGA STABILIZED (BEAST MODE) -->
232
+ <!-- filterBeta: 10000 = smoothing ESTREMO, missTolerance: 100 = 3+ sec di grace period -->
233
  <a-scene
234
+ mindar-image="imageTargetSrc: img/targets.mind; filterMinCF:0.0000001; filterBeta: 10000; uiLoading: no; uiScanning: no; missTolerance: 100; warmupTolerance: 1; maxTrack: 1"
235
  color-space="sRGB"
236
+ renderer="colorManagement: true, physicallyCorrectLights, highRefreshRate: true, antialias: true"
237
  vr-mode-ui="enabled: false"
238
  device-orientation-permission-ui="enabled: false">
239
 
 
244
  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
245
 
246
  <a-entity id="example-target" mindar-image-target="targetIndex: 0">
247
+ <!-- VIDEO 16:9 con CSS smoothing extra -->
248
  <a-entity id="myVid"
249
  geometry="primitive: plane; width: 1.6; height: 0.9"
250
  material="src: #vid; shader: flat; transparent: true; opacity: 1"
251
+ position="0 0 0"
252
+ animation__smooth="property: position; dur: 200; easing: easeOutQuad; loop: false">
253
  </a-entity>
254
 
255
  <!-- Cornice Cyberpunk 16:9 -->
 
265
  <a-plane position="-0.77 0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
266
  <a-plane position="0.77 -0.41 0.01" width="0.15" height="0.03" color="white" material="shader: flat; opacity: 0.9"></a-plane>
267
 
268
+ <a-text value="INNOVATION_LAB_DEV" color="#00ff41" align="center" width="1.5" position="0 -0.6 0.01"
269
  font="https://cdn.aframe.io/fonts/Roboto-msdf.json">
270
  <a-animation attribute="opacity" from="0.3" to="1" dur="800" direction="alternate" repeat="indefinite"></a-animation>
271
  </a-text>
 
292
 
293
  let isAudioEnabled = false;
294
  let loadProgress = 0;
295
+ let smoothPositionX = 0;
296
+ let smoothPositionY = 0;
297
+ let smoothPositionZ = 0;
298
+ const SMOOTHING_FACTOR = 0.5; // 5% update per frame = ultra smooth
299
+
300
+ // CUSTOM SMOOTHING LAYER - Questo è il segreto!
301
+ const myVidEntity = document.querySelector("#myVid");
302
+ let lastPosition = {x: 0, y: 0, z: 0};
303
+
304
+ // Applica smoothing custom ogni frame
305
+ setInterval(() => {
306
+ if(myVidEntity && target.object3D.visible) {
307
+ const currentPos = target.object3D.position;
308
+
309
+ // Lerp (Linear interpolation) per smooth movement
310
+ smoothPositionX += (currentPos.x - smoothPositionX) * SMOOTHING_FACTOR;
311
+ smoothPositionY += (currentPos.y - smoothPositionY) * SMOOTHING_FACTOR;
312
+ smoothPositionZ += (currentPos.z - smoothPositionZ) * SMOOTHING_FACTOR;
313
+
314
+ // Applica la posizione smoothed al target
315
+ if(Math.abs(currentPos.x - lastPosition.x) > 0.001 ||
316
+ Math.abs(currentPos.y - lastPosition.y) > 0.001 ||
317
+ Math.abs(currentPos.z - lastPosition.z) > 0.001) {
318
+ target.object3D.position.set(smoothPositionX, smoothPositionY, smoothPositionZ);
319
+ lastPosition = {x: smoothPositionX, y: smoothPositionY, z: smoothPositionZ};
320
+ }
321
+ }
322
+ }, 16); // 60fps
323
 
324
  // Easter Egg 1: Fake FPS Counter
325
  setInterval(() => {