pnext / three-loader

Point cloud loader for ThreeJS, based on the core parts of Potree
Other
210 stars 90 forks source link

Support point picking in special camera systems #19

Closed alejandrodecea closed 5 years ago

alejandrodecea commented 5 years ago

In case you've got something like Three.js's PointerLockControls, the camera's relative position will always be (0, 0, 0), with this change, now it's possible to use the point picking function with such camera systems.

hccampos commented 5 years ago

I am sorry but unfortunately I am not confident that this won't break existing projects. Furthermore, the package.json should only be updated by the maintainers when a release is to happen.

alejandrodecea commented 5 years ago

Apologies for taking so long to answer, upon closer review in the original potree I believe that the camera position isn't being used in the pick function (see it here). I might be wrong though.

P.S.: I made all those other changes in order to be able to publish the package to npm and use it in my own project, I didn't realize they were being reflected here as well.

alejandrodecea commented 5 years ago

I recently noticed @Zielon included a pixelPosition parameter for the picking function. Now I can input my own pixelPosition using the ray.origin instead of the camera.position. Thank you kindly for that!