diff --git a/GUI_Standby.png b/GUI_Standby.png
new file mode 100644
index 0000000..0488fdc
Binary files /dev/null and b/GUI_Standby.png differ
diff --git a/check_indices.js b/check_indices.js
new file mode 100644
index 0000000..0fd9da3
--- /dev/null
+++ b/check_indices.js
@@ -0,0 +1,22 @@
+const fs = require('fs');
+
+function checkIndices(filePath) {
+ const buffer = fs.readFileSync(filePath);
+ const jsonLen = buffer.readUInt32LE(12);
+ const jsonBuf = buffer.slice(20, 20 + jsonLen);
+ const gltf = JSON.parse(jsonBuf.toString());
+
+ [37, 41].forEach(idx => {
+ console.log(`Node [${idx}]:`, gltf.nodes[idx] ? gltf.nodes[idx].name : 'OUT OF RANGE');
+ if (gltf.nodes[idx] && gltf.nodes[idx].mesh !== undefined) {
+ const meshIdx = gltf.nodes[idx].mesh;
+ console.log(` Mesh [${meshIdx}]:`, gltf.meshes[meshIdx].name);
+ }
+ });
+
+ [37, 41].forEach(idx => {
+ console.log(`Mesh [${idx}]:`, gltf.meshes[idx] ? gltf.meshes[idx].name : 'OUT OF RANGE');
+ });
+}
+
+checkIndices('Cabinet v2.5 con eje.glb');
diff --git a/index.html b/index.html
index 2422267..4b37ac5 100644
--- a/index.html
+++ b/index.html
@@ -104,6 +104,37 @@
backdrop-filter: blur(10px);
text-align: center;
z-index: 5;
+ display: flex;
+ align-items: center;
+ gap: 15px;
+ }
+
+ #btn-home {
+ background: var(--primary);
+ color: white;
+ border: none;
+ padding: 8px 16px;
+ border-radius: 20px;
+ cursor: pointer;
+ font-size: 13px;
+ font-weight: 600;
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+ pointer-events: auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
+ white-space: nowrap;
+ }
+
+ #btn-home:hover {
+ background: #005bb7;
+ transform: translateY(-2px);
+ box-shadow: 0 6px 15px rgba(0, 122, 255, 0.4);
+ }
+
+ #btn-home:active {
+ transform: translateY(0);
}
/* Interaction Tooltip (Click to open) */
@@ -342,7 +373,8 @@
- 🖱️ Click to interact | Right-click to pan | Simulator on the right
+ 🖱️ Click to interact | Right-click to pan | Simulator on the right
+
@@ -441,6 +473,12 @@
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.6/');
loader.setDRACOLoader(dracoLoader);
+ // --- Texture Loading ---
+ const textureLoader = new THREE.TextureLoader();
+ const standbyTexture = textureLoader.load('GUI_Standby.png');
+ standbyTexture.colorSpace = THREE.SRGBColorSpace;
+ standbyTexture.flipY = false; // GLTF standard
+
let model = null;
let isDoorOpen = false;
let hingePivot = null; // THREE.Group at the hinge axis
@@ -455,6 +493,15 @@
if (child.isMesh) {
child.castShadow = true;
child.receiveShadow = true;
+
+ // Ensure smooth shading
+ if (child.geometry) {
+ child.geometry.computeVertexNormals();
+ }
+ if (child.material) {
+ child.material.flatShading = false;
+ child.material.needsUpdate = true;
+ }
}
});
}
@@ -471,7 +518,8 @@
ior: 1.58, // Index of Refraction for PC
depthWrite: true, // Better for Physical materials in many cases
envMapIntensity: 2.5, // Stronger reflections
- side: THREE.DoubleSide
+ side: THREE.DoubleSide,
+ flatShading: false
});
// Highly transparent glass material (Clear)
@@ -485,7 +533,8 @@
ior: 1.5, // Index of Refraction for Class
depthWrite: true,
envMapIntensity: 3.0,
- side: THREE.DoubleSide
+ side: THREE.DoubleSide,
+ flatShading: false
});
// White non-transparent acrylic material
@@ -495,7 +544,8 @@
metalness: 0.0,
transparent: false,
envMapIntensity: 0.8,
- side: THREE.DoubleSide
+ side: THREE.DoubleSide,
+ flatShading: false
});
// Aluminum material for the lock
@@ -503,7 +553,8 @@
color: 0xe5e5e5, // Lighter, typical of aluminum
metalness: 1.0,
roughness: 0.4, // Slightly more matte than stainless steel
- envMapIntensity: 1.5
+ envMapIntensity: 1.5,
+ flatShading: false
});
const acrylicTargetNames = [
@@ -540,6 +591,17 @@
});
const lastEntry = meshList[meshList.length - 1];
+ // 0. GUI STANDBY (Specific Screen Mesh)
+ if (normMesh.includes('SOLID1_61')) {
+ child.material = new THREE.MeshBasicMaterial({
+ map: standbyTexture,
+ transparent: true,
+ side: THREE.DoubleSide
+ });
+ lastEntry.matched = "📺 GUI STANDBY";
+ console.log(`📺 [HIERARCHY MATCH] Applied GUI_Standby.png to: Mesh="${meshName}" Parent="${parentName}"`);
+ }
+
// Capture Console Material for synchronization
if (combinedNorm.includes('LADODERECHOCONSOLA')) {
consoleMaterial = child.material;
@@ -657,7 +719,8 @@
emissive: 0xffffff,
emissiveIntensity: 10, // High intensity to simulate glow
metalness: 0.1,
- roughness: 0.1
+ roughness: 0.1,
+ flatShading: false
});
// Add an actual interior light source to simulate light coming from the LED bar
@@ -795,7 +858,8 @@
color: 0x555555, // Base grey
emissive: 0x333333, // Subtle glow to look "lighter"
metalness: 0.6,
- roughness: 0.4
+ roughness: 0.4,
+ flatShading: false
});
mesh.material = newMat;
fixedCount++;
@@ -982,6 +1046,9 @@
`);
if (!isDoorOpen) toggleDoor();
+ } else if (normName.includes('SOLID1_103')) {
+ zoomToBiometric(object);
+ showAnnotation(object, "Reconocimiento facial (Opcional)
Apertura de puerta con reconocimiento facial");
} else if (normName.includes('MESHFEATURE1') || normName.includes('SOLID1_105')) {
zoomToCamera(object);
showAnnotation(object, "Cámara (Opcional)
Grabación de sesión cuando se abre la puerta.");
@@ -1040,8 +1107,8 @@
}
function zoomToBiometric(target) {
- const cameraFrontalPos = new THREE.Vector3(0, 1.2, 4);
- const lookAtTarget = new THREE.Vector3(0, 0.8, 0);
+ const cameraFrontalPos = new THREE.Vector3(0.048, 0.720, 4.001);
+ const lookAtTarget = new THREE.Vector3(-0.033, -0.279, 0.108);
smoothCameraTransition(cameraFrontalPos, lookAtTarget);
}
@@ -1114,7 +1181,7 @@
if (intersects.length > 0) {
const name = intersects[0].object.name.toLowerCase();
- if (name.includes('puerta') || name.includes('bisagra') || name.includes('lector') || name.includes('solid') || name.includes('cilindro') || name.includes('cerradura') || name.includes('solid1_102')) {
+ if (name.includes('puerta') || name.includes('bisagra') || name.includes('lector') || name.includes('solid') || name.includes('cilindro') || name.includes('cerradura') || name.includes('solid1_102') || name.includes('solid1_103')) {
canvas.style.cursor = 'pointer';
return;
}
@@ -1123,17 +1190,30 @@
});
function showInfo(title, text) {
+ const content = document.getElementById('info-content');
const panel = document.querySelector('.info-panel');
- panel.innerHTML = `${title}
${text}`;
+ content.innerHTML = `${title}
${text}`;
panel.style.background = 'rgba(0, 122, 255, 0.9)';
}
function hideInfo() {
+ const content = document.getElementById('info-content');
const panel = document.querySelector('.info-panel');
- panel.innerHTML = '🖱️ Click components to explore | Right-click to pan | Scroll to zoom';
+ content.innerHTML = '🖱️ Click components to explore | Right-click to pan | Scroll to zoom';
panel.style.background = 'rgba(0, 0, 0, 0.7)';
}
+ function resetView() {
+ const defaultPos = new THREE.Vector3(3.000, 1.500, 5.000);
+ const defaultTarget = new THREE.Vector3(0.000, 0.000, 0.000);
+ smoothCameraTransition(defaultPos, defaultTarget);
+ }
+
+ document.getElementById('btn-home').addEventListener('click', (e) => {
+ e.stopPropagation();
+ resetView();
+ });
+
function toggleDoor() {
if (!hingePivot) return;
isDoorOpen = !isDoorOpen;
diff --git a/inspect_solid1_61.js b/inspect_solid1_61.js
new file mode 100644
index 0000000..fd0c747
--- /dev/null
+++ b/inspect_solid1_61.js
@@ -0,0 +1,51 @@
+const fs = require('fs');
+
+function inspectMesh(filePath, query) {
+ const buffer = fs.readFileSync(filePath);
+ const jsonLen = buffer.readUInt32LE(12);
+ const jsonBuf = buffer.slice(20, 20 + jsonLen);
+ const gltf = JSON.parse(jsonBuf.toString());
+
+ console.log(`Inspecting mesh named "${query}"...`);
+
+ let targetMesh = null;
+ let targetNode = null;
+
+ if (gltf.nodes) {
+ gltf.nodes.forEach((n, i) => {
+ if (n.name && n.name.toUpperCase().includes(query.toUpperCase())) {
+ console.log(`Node [${i}]: ${n.name}`);
+ targetNode = n;
+ if (n.mesh !== undefined) {
+ targetMesh = gltf.meshes[n.mesh];
+ console.log(` Linked Mesh: ${targetMesh.name || 'unnamed'}`);
+ }
+ }
+ });
+ }
+
+ if (!targetMesh && gltf.meshes) {
+ gltf.meshes.forEach((m, i) => {
+ if (m.name && m.name.toUpperCase().includes(query.toUpperCase())) {
+ console.log(`Mesh [${i}]: ${m.name}`);
+ targetMesh = m;
+ }
+ });
+ }
+
+ if (targetMesh) {
+ console.log('\nMesh Details:');
+ targetMesh.primitives.forEach((p, i) => {
+ console.log(` Primitive [${i}]:`);
+ console.log(` Attributes: ${Object.keys(p.attributes).join(', ')}`);
+ if (p.material !== undefined) {
+ const mat = gltf.materials[p.material];
+ console.log(` Material: ${mat.name || 'unnamed'}`);
+ }
+ });
+ } else {
+ console.log('Target mesh not found.');
+ }
+}
+
+inspectMesh('Cabinet v2.5 con eje.glb', 'Solid1_61');
diff --git a/search_meshes.js b/search_meshes.js
new file mode 100644
index 0000000..37c5862
--- /dev/null
+++ b/search_meshes.js
@@ -0,0 +1,28 @@
+const fs = require('fs');
+
+function searchNames(filePath, query1, query2) {
+ const buffer = fs.readFileSync(filePath);
+ const jsonLen = buffer.readUInt32LE(12);
+ const jsonBuf = buffer.slice(20, 20 + jsonLen);
+ const gltf = JSON.parse(jsonBuf.toString());
+
+ console.log(`Searching for "${query1}" and "${query2}"...`);
+
+ if (gltf.nodes) {
+ gltf.nodes.forEach((n, i) => {
+ if (n.name && (n.name.includes(query1) || n.name.includes(query2))) {
+ console.log(`Node [${i}]: ${n.name}`);
+ }
+ });
+ }
+
+ if (gltf.meshes) {
+ gltf.meshes.forEach((m, i) => {
+ if (m.name && (m.name.includes(query1) || m.name.includes(query2))) {
+ console.log(`Mesh [${i}]: ${m.name}`);
+ }
+ });
+ }
+}
+
+searchNames('Cabinet v2.5 con eje.glb', '37', '41');
diff --git a/search_target_meshes.js b/search_target_meshes.js
new file mode 100644
index 0000000..f895f61
--- /dev/null
+++ b/search_target_meshes.js
@@ -0,0 +1,33 @@
+const THREE = require('three');
+const { GLTFLoader } = require('three/examples/jsm/loaders/GLTFLoader.js');
+const fs = require('fs');
+const { JSDOM } = require('jsdom');
+
+// Mock window and document for GLTFLoader
+const dom = new JSDOM();
+global.window = dom.window;
+global.document = dom.window.document;
+global.navigator = dom.window.navigator;
+
+const loader = new GLTFLoader();
+
+const data = fs.readFileSync('Cabinet v2.5 con eje.glb');
+const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
+
+loader.parse(arrayBuffer, '', (gltf) => {
+ const targetNames = ['Solid1_114', 'Solid1_37', 'Solid1_41'];
+ console.log('--- Searching for specific meshes ---');
+ gltf.scene.traverse((child) => {
+ if (targetNames.includes(child.name)) {
+ console.log(`Found: ${child.name} | Type: ${child.type} | Parent: ${child.parent ? child.parent.name : 'None'}`);
+ }
+ // Also check if they are contained in the name
+ targetNames.forEach(tn => {
+ if (child.name.includes(tn) && child.name !== tn) {
+ console.log(`Partial Match: ${child.name} (contains ${tn}) | Type: ${child.type}`);
+ }
+ });
+ });
+}, (err) => {
+ console.error(err);
+});