Answer the question
In order to leave comments, you need to log in
How to determine neighboring points?
There is a 3d scene on which there are many points, when choosing the Y point, I need to find the nearest points to the left and right.
I managed to determine the nearest points due to the distanceTo function
var myPoint = new THREE.Vector3(point.x, point.y, point.z)
for (var i = 0; i < points.length; i++) {
var vector = new THREE.Vector3(points[i].x, point.y, points[i].z);
//получаю дистанцию
myPoint.distanceTo(vector);
}
Answer the question
In order to leave comments, you need to log in
There is nothing easier to check that the point is to the right of myPoint:
point.x < point[i].x
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question