Listen for ATON Tap event
This commit is contained in:
25
js/scene.js
25
js/scene.js
@@ -109,6 +109,7 @@ function loadNodes(nodes) {
|
||||
|
||||
if (n.isSemantic) {
|
||||
createSemanticNode(n.model, n.label);
|
||||
AppState.semanticNodes.set(n.label, n.content);
|
||||
//ATON.getSemanticRoot().attach(semNode);
|
||||
}
|
||||
|
||||
@@ -123,30 +124,6 @@ function loadNodes(nodes) {
|
||||
console.error("No bounding sphere computed, clipping will fail. Ensure one node has 'isMain: true'.");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Uses a generic sphere shape as semantic annotation
|
||||
* @param {Sphere} bound The scene node's bounding sphere
|
||||
* @param {string} id The original scene node ID (3D object)
|
||||
* @returns {ATON.SceneNode}
|
||||
function createSemanticNode(bound, id) {
|
||||
// Default/highlight materials for semantic node
|
||||
let matSemDef = ATON.MatHub.materials.semanticShape;
|
||||
let matSemHL = ATON.MatHub.materials.semanticShapeHL;
|
||||
|
||||
const semNode = ATON.createSemanticNode(id)
|
||||
.setDefaultAndHighlightMaterials(matSemDef, matSemHL)
|
||||
.attachToRoot();
|
||||
|
||||
const sphereCenter = bound.center;
|
||||
const sphereRadius = bound.radius * 0.2;
|
||||
|
||||
let sphere = ATON.SemFactory.createSphere(id, sphereCenter, sphereRadius);
|
||||
|
||||
console.debug('Bound:', bound);
|
||||
console.debug('Semantic sphere:', sphere);
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a semantic annotation from a model
|
||||
* @param {string} model The model's path to load
|
||||
|
||||
Reference in New Issue
Block a user