require(Rvcg)
data(humface)
set.seed(42)
clust <- fastKmeans(humface,k=1000,threads=1)
if (FALSE) {
require(rgl)
## plot the cluster centers
spheres3d(clust$centers)
## now look at the vertices closest to the centers
wire3d(humface)
spheres3d(vert2points(humface)[clust$selected,],col=2)
}
Run the code above in your browser using DataLab