New feature: Mesh Hotspots

I love it ! :grin:
I remember helping @alexandremottet when he was trying exactly this, manually, in this topic
Compared to such manual solution (double click on surface) :

const indices = pickedMesh.getIndices();
let bw = 1 - bu - bv;
// run the following on each render :
let pointPosition = BABYLON.Vector3.Zero();
pointPosition.addInPlace(facePositions[0].scale(bu));
pointPosition.addInPlace(facePositions[1].scale(bv));
pointPosition.addInPlace(facePositions[2].scale(bw));
// etc, etc...

We will save a lot of code ! :grin:


Is it supposed to work as well at picking time or not ? Because what I can notice, is that on my side, even tough it works after picking (tracking of the point along animated surface), the picking itself seems to happen on the static mesh (picking multiple times at the same 2D spot won’t change the picked point, while the animation is running. Also, sometimes picking outside in the background actually picks the mesh, etc…)

2 Likes