r-lidar-lab / lidRviewer

An OpenGL point cloud viewer for R able to handle several millions of points
75 stars 16 forks source link

Usage of id option in plot function #1

Closed uleopold closed 6 years ago

uleopold commented 6 years ago

Hi,

great work. It is indeed very performing. I am just struggling to use the id option. Your example perfectly works. I am now trying to apply it to a LiDAR point cloud and would like to colourize the Z values with height colours. But somehow it is not clear to me how to use the "id" option in this case, except generating random colours. Also the regular specifications of color palettes does not work as used in rgl.

Could put an example for a LiDAR data set and rainbow(50) or height.colours(50) ?

Thanks, a lot.

Jean-Romain commented 6 years ago

I make this modification yesterday. So it is still perfectible. You can do the following

col = height.colours(50)
id = cut(Z, 50, label = FALSE)

By the way the lidR package will take advantage of this feature soon and in a seamless way.

uleopold commented 6 years ago

Works perfectly! Thanks a lot! I am great fan of your packages. Very useful, in particular the lidR and rlas packages.

Are you planning to also add grid display as currently possible through rgl in the lidR package ?

Jean-Romain commented 6 years ago

No plan for that sorry. We should never say never but not soon for sure. It is a much more complex task and I don't have the knowledge to make that yet.

Jean-Romain commented 6 years ago

I pushed a new version in the devel branch of lidR that support the new developments in PointCloudViewer.

Btw how did you installed the package PointCloudViewer. And on which operating system? Are my explanation useful?

uleopold commented 6 years ago

Excellent. Will check it out the next week.

I installed it according to your instructions on Ubuntu 16.04. Compiled it from inside of R. Was very helpful your explanations.