Hi, I have created the TubeBufferGeometry. The code is following:
var curve = new THREE.CatmullRomCurve3( pointArray, false, "centripetal"); var geometry = new THREE.TubeBufferGeometry( curve, curveSegments, tubeRadius, radiusSegments, closed );
In the Raycaster.intersectObject(), I can get the following results.
distance – distance between the origin of the ray and the intersection
point – point of intersection, in world coordinates
face – intersected face
faceIndex – index of the intersected face
object – the intersected object
uv - U,V coordinates at point of intersection
Now I can get the intersected point position in TubeBufferGeometry when moving the mouse.
How can I find the nearest point in the pointArray to the intersected point？
Should I change the coordination of the intersected point into world vector?