diff --git a/app.js b/app.js index 085ed8f8..9ba20dab 100644 --- a/app.js +++ b/app.js @@ -3129,3 +3129,20 @@ init().then(() => { connectMemPalace(); mineMemPalaceContent(); }); + +// Project Mnemosyne — Holographic Memory +function spawnMemoryOrb(position, color = 0x4af0c0, size = 0.5) { + const geometry = new THREE.SphereGeometry(size, 32, 32); + const material = new THREE.MeshPhongMaterial({ + color: color, + emissive: color, + emissiveIntensity: 2, + transparent: true, + opacity: 0.8, + shininess: 100 + }); + const orb = new THREE.Mesh(geometry, material); + orb.position.copy(position); + orb.userData.pulse = 0; + return orb; +} diff --git a/frontend/js/scene-objects.js b/frontend/js/scene-objects.js index 7ea39ad6..022c7c05 100644 --- a/frontend/js/scene-objects.js +++ b/frontend/js/scene-objects.js @@ -503,6 +503,11 @@ export function getSceneObjectCount() { export function addPortal(def) { if (!scene || !def.id) return false; + // Remove existing portal if it already exists to prevent duplication + if (registry.has(def.id)) { + removePortal(def.id); + } + const color = def.color != null ? parseColor(def.color) : 0x00ffaa; const s = def.scale ?? 1; const group = new THREE.Group(); diff --git a/frontend/js/websocket.js b/frontend/js/websocket.js index 353507aa..7673f706 100644 --- a/frontend/js/websocket.js +++ b/frontend/js/websocket.js @@ -193,9 +193,13 @@ function handleMemoryEvent(msg) { geometry: 'sphere', position: { x: pos.x + (Math.random() - 0.5) * 5, y: 1, z: pos.z + (Math.random() - 0.5) * 5 }, material: { + type: 'physical', color: categoryColors[data.category] || 0xcccccc, emissive: categoryColors[data.category] || 0xcccccc, - emissiveIntensity: 2, + emissiveIntensity: 3, + transmission: 0.6, + roughness: 0.1, + metalness: 0.1, opacity: 0.8, }, scale: 0.2 + (data.trust_score || 0.5) * 0.5,