By default, annotations are displayed on a scene with a +
icon. When hovered over (or clicked/tapped) a tooltip will appear with the annotation text.
However, this default behavior can be overridden by passing a showAnnotations
function into the intiialization options for the interactive embed.
$('#my-clara-scene').clara({
id: 'uuid',
showAnnotations: function(annotations) {
annotations.forEach(function(annotation) {
console.log('Annotation: ', annotation.text, annotation.alpha);
});
}
});
Each time the viewport gets updated (as the camera moves, for example), this function will be called. Since this may occur many times per second, this function should be fast.
An array of objects will be passed to the function, where each object will contain all of the information relevant to displaying the annotation:
There are other attributes available for more advanced cases:
node.annotation
.