Reaperxxxx commited on
Commit
b2a9cad
·
verified ·
1 Parent(s): 7a8385c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +5 -3
index.html CHANGED
@@ -377,7 +377,8 @@
377
  fbxLoader.load('./character.fbx', (fbx) => {
378
  playerModel = new THREE.Group();
379
 
380
- // Add the FBX model to a group for easier manipulation
 
381
  fbx.scale.set(0.01, 0.01, 0.01);
382
 
383
  // Make character visible with proper materials
@@ -385,7 +386,6 @@
385
  if (child.isMesh) {
386
  child.castShadow = true;
387
  child.receiveShadow = true;
388
- // Ensure materials are visible
389
  if (child.material) {
390
  child.material.transparent = false;
391
  child.material.opacity = 1;
@@ -401,7 +401,9 @@
401
  loadingSteps.character = true;
402
  updateLoadingStatus();
403
  console.log('✅ Character loaded!');
404
- console.log('Character position:', playerModel.position);
 
 
405
  }, (xhr) => {
406
  const percent = (xhr.loaded / xhr.total * 100).toFixed(1);
407
  document.getElementById('loading').textContent = `Loading character ${percent}%`;
 
377
  fbxLoader.load('./character.fbx', (fbx) => {
378
  playerModel = new THREE.Group();
379
 
380
+ // Reset FBX position to origin before scaling
381
+ fbx.position.set(0, 0, 0);
382
  fbx.scale.set(0.01, 0.01, 0.01);
383
 
384
  // Make character visible with proper materials
 
386
  if (child.isMesh) {
387
  child.castShadow = true;
388
  child.receiveShadow = true;
 
389
  if (child.material) {
390
  child.material.transparent = false;
391
  child.material.opacity = 1;
 
401
  loadingSteps.character = true;
402
  updateLoadingStatus();
403
  console.log('✅ Character loaded!');
404
+ console.log('Character world position:', playerModel.position);
405
+ console.log('FBX local position:', fbx.position);
406
+ console.log('Camera position:', camera.position);
407
  }, (xhr) => {
408
  const percent = (xhr.loaded / xhr.total * 100).toFixed(1);
409
  document.getElementById('loading').textContent = `Loading character ${percent}%`;