Reaperxxxx commited on
Commit
1e2ae7b
·
verified ·
1 Parent(s): b8d3926

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +7 -10
index.html CHANGED
@@ -640,24 +640,21 @@
640
 
641
  if (playerModel) {
642
  playerModel.position.set(playerPos.x, playerPos.y, playerPos.z);
 
643
  playerModel.rotation.y = cameraRotation.y;
644
  }
645
 
646
- // Position camera to see character's torso and legs (first-person perspective from head/neck area)
647
- // Camera at same position as character, just offset slightly back to see the body
648
- const cameraOffset = new THREE.Vector3(0, 0, 0.15);
649
- const rotatedOffset = cameraOffset.clone();
650
- rotatedOffset.applyAxisAngle(new THREE.Vector3(0, 1, 0), cameraRotation.y);
651
-
652
  camera.position.set(
653
- playerPos.x + rotatedOffset.x,
654
- playerPos.y,
655
- playerPos.z + rotatedOffset.z
656
  );
657
 
658
  camera.rotation.order = 'YXZ';
659
  camera.rotation.y = cameraRotation.y;
660
- camera.rotation.x = cameraRotation.x - 0.3; // Look down to see torso/legs
661
 
662
  updateCoordinates();
663
  renderer.render(scene, camera);
 
640
 
641
  if (playerModel) {
642
  playerModel.position.set(playerPos.x, playerPos.y, playerPos.z);
643
+ // Character rotation should match camera Y rotation so it faces forward
644
  playerModel.rotation.y = cameraRotation.y;
645
  }
646
 
647
+ // Position camera inside/at the character's head position to see body below
648
+ // Camera looks down from character's head to see torso and legs
 
 
 
 
649
  camera.position.set(
650
+ playerPos.x,
651
+ playerPos.y + 0.15, // Slightly above character base (at head level)
652
+ playerPos.z
653
  );
654
 
655
  camera.rotation.order = 'YXZ';
656
  camera.rotation.y = cameraRotation.y;
657
+ camera.rotation.x = cameraRotation.x - 0.4; // Look down more to see body
658
 
659
  updateCoordinates();
660
  renderer.render(scene, camera);