17 lines
529 B
JavaScript
17 lines
529 B
JavaScript
|
|
import * as THREE from 'three';
|
|
class ResonanceVisualizer {
|
|
constructor(scene) {
|
|
this.scene = scene;
|
|
this.links = [];
|
|
}
|
|
addLink(p1, p2, strength) {
|
|
const geometry = new THREE.BufferGeometry().setFromPoints([p1, p2]);
|
|
const material = new THREE.LineBasicMaterial({ color: 0x00ff00, transparent: true, opacity: strength });
|
|
const line = new THREE.Line(geometry, material);
|
|
this.scene.add(line);
|
|
this.links.push(line);
|
|
}
|
|
}
|
|
export default ResonanceVisualizer;
|