简体   繁体   中英

Points not showing in simple pptk example

I have just started using pptk the open source point cloud viewer. It worked perfectly when I used the example of displaying the bildstein_station1_xyz_intensity_rgb.txt as per the tutorial so I do not think there can be much wrong but when I try to display 100 random points the viewer opens and says it is displaying the points but I can see nothing. The code is that given in the tutorial.

import pptk
import numpy as np

xyz = pptk.rand(10, 3)

v = pptk.viewer(xyz)
v.set(point_size=0.5)

I have tried changing the point_size parameter without success. Has anybody used this library and have any idea what I am doing wrong

Finally got it to work. You need to provide the colour attributes of the points in an attributes statement. As the rgb colours seem to be specified as numbers in range 0 to 1 if you pass the same xyz points array ( or use a numpy array) to the attributes you get a cube of different coloured dots ie there no longer seems to be a default colour value that is displayed

import pptk
import numpy as np

 xyz = pptk.rand(10, 3)

 v = pptk.viewer(xyz)
 v.attributes(xyz)
 v.set(point_size=0.01)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM