Hello,
I have issues with picking (works well in Potree), been trying to fix it by going deep into potree's code and this typescript project.
private static addPositionToPickPoint(
point: PickPoint,
hit: PointCloudHit,
values: BufferAttribute,
points: Points
): void {
console.log(`values length ${ values.array.length } / index ${ hit.pIndex }`);
point.position = new Vector3()
.fromBufferAttribute(values, hit.pIndex)
.applyMatrix4(points.matrixWorld);
}
At the end we're getting a pIndex which corresponds to the bufferGeometry position index of the pcIndex's Node.
To find the final position, getting a vector3 from the bufferGeometry is indeed simple.
While logging the bufferGeometry values lenght and the pIndex; I have found that most of the time the pIndex is too high for the lenght of the bufferGeometry (.fromBufferAttribute will take in this code the 3*pIndex because of size of Vector3).
I tried concerning this issue :
- Debugging buffer's iBuffer and render target using Texture helper - they seems to match Potree's.
- See if we were missing nodes on the ray but that does not seems to be the case.
My current hypothesis is that the pick parameters of the pick material are wrong, and the pIndex value we're getting in the iBuffer is wrong aswell.
Wonder if someone had this issue or someone fixed it elsewhere ?
Hello,
I have issues with picking (works well in Potree), been trying to fix it by going deep into potree's code and this typescript project.
At the end we're getting a pIndex which corresponds to the bufferGeometry position index of the pcIndex's Node.
To find the final position, getting a vector3 from the bufferGeometry is indeed simple.
While logging the bufferGeometry values lenght and the pIndex; I have found that most of the time the pIndex is too high for the lenght of the bufferGeometry (.fromBufferAttribute will take in this code the 3*pIndex because of size of Vector3).
I tried concerning this issue :
My current hypothesis is that the pick parameters of the pick material are wrong, and the pIndex value we're getting in the iBuffer is wrong aswell.
Wonder if someone had this issue or someone fixed it elsewhere ?