verma / plasio

Drag-n-drop In-browser LAS/LAZ point cloud viewer. http://plas.io
http://plas.io
MIT License
491 stars 129 forks source link

Editing point cloud #61

Open mghildiy opened 6 years ago

mghildiy commented 6 years ago

Hi,

I want to customize this repo to tinker with point cloud rendered from a LAS/LAZ file. Which code files should I start to look into in particular?

Manish

@verma @hobu

mghildiy commented 6 years ago

Going through the code, I can see files lazlaz.js and renderer.js playing important roles in bigger picture. laslaz.js loads the las/laz file. And going by the name,renderer.js must be displaying the data in laz/laz file using three.js. But where do we give input(data read from laz/laz file) to renderer.js?

verma commented 6 years ago

I would start here:

https://github.com/verma/plasio/blob/master/js/ui.js#L657

This is where the loading happens, it takes a function which returns a promise which resolve with the loaded data (either local or remote), eventually if you trace this function, it should call another function called loadData which will eventually link stuff to Three.js.

mghildiy commented 6 years ago

Thanks a lot @verma.

mghildiy commented 6 years ago

I was able to link up three modules(lazlaz.js,ui.js,render.js) and understand the flow. I then made a small change in render.js right at end of ParticleSystemBatcher.prototype.push.

var object = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial( 0xff0000 ) ); var box = new THREE.BoxHelper( object, 0xffff00 ); scene.add(box);

My objective is to add bounding box for the point cloud. It did add a wireframe box, but orientation is perpendicular to the expected direction.

boundingbox

Am I doing it wrongly?

@verma , do you have any insight on this behaviour?

mghildiy commented 6 years ago

@verma,any input here? I added a wireframe box as bounding box for point cloud.But alignment is totally unexpected, as shown in above figure.