heremaps / pptk

The Point Processing Toolkit (pptk) is a Python package for visualizing and processing 2-d/3-d point clouds.
https://heremaps.github.io/pptk
MIT License
610 stars 112 forks source link

viewer as cloud player #15

Open rfsch opened 5 years ago

rfsch commented 5 years ago

Hi

is it possible to make the viewer play successive point cloud frames ?

Thanks

kentaroy47 commented 5 years ago

+1

chiricoiu commented 4 years ago

+1

chenxyyy commented 4 years ago

+1

tsucres commented 3 years ago

I got it to work by commenting the following lines in viewer.h (in void reply()):

qDebug() << "Viewer: received positions";

_points->loadPoints(positions);
// Comment the 3 following lines
//_camera = QtCamera(_points->getBox());
//_camera.setAspectRatio((float)width() / height());
//_floor_grid->setFloorLevel(_points->getFloor());
renderPoints();
renderPointsFine();
break;

I am not sure whether there are situations where it is necessary to reset the camera position after loading a new pointcloud. But this solution suits my use case.

After re-compiling, the following snippet will render a sequence of random pointclouds while maintaining the camera position:

import pptk
import numpy as np
import time

pointclouds = np.random.random([200, 1000, 3])

v = pptk.viewer(pointclouds[0])

for pc in pointclouds[1:]:
    time.sleep(0.1)
    v.load(pc)

(I share this as a workaround, not as a solution to the current issue)