Hi everyone,
I hope someone can help me out of this rabbithole
I’m currently trying to figure out how I can retrieve the position of the intersection between my cursors x and y projected to the closest geometry/node - resembling Three.js raycaster method.
Is the SelectionExtension able to return a node position? If so, what steps am I missing in order to fully enable hover?
const cameraControls = viewerInstance.createExtension(CameraController);
const selectionInstance =viewerInstance.createExtension(SelectionExtension);
selectionInstance.enabled = true;
selectionInstance.hoverMaterialData = {
id: MathUtils.generateUUID(),
color: 0x047efb,
opacity: 1,
roughness: 1,
metalness: 0,
vertexColors: false,
lineWeight: 1,
stencilOutlines: true,
pointSize: 4,
depthWrite: true,
};
selectionInstance.applyHover();
If not, is there a way I can implement SpeckleRaycaster? It doesn’t seem like it was intended to be imported?
I have also tried implementing Three.js own Raycaster, however I’m not sure it’s easy to adjust the the speckle data structure to three.js implementation.