Skip to content
Snippets Groups Projects
Commit 70b1db3a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Bounce and remove scene reset

parent 32c656b8
No related branches found
No related tags found
1 merge request!12Feature/voxelhash
......@@ -398,17 +398,22 @@ static void run() {
float3 *point_array = new float3[rayparams.m_width*rayparams.m_height];
uchar3 *colour_array = new uchar3[rayparams.m_width*rayparams.m_height];
float bounce = 0.0;
int bounce_dir = 1;
net.broadcast("grab"); // To sync cameras
int active = inputs.size();
while (active > 0 && display_merged.active()) {
active = 0;
net.broadcast("grab"); // To sync cameras
PointCloud<PointXYZRGB>::Ptr cloud(new PointCloud<PointXYZRGB>);
// TODO (Nick) Should be able to only partially clear...
LOG(INFO) << "RESET";
scene.reset();
//scene.reset();
for (size_t i = 0; i < inputs.size(); i++) {
//if (i == 1) continue;
......@@ -453,10 +458,14 @@ static void run() {
uniform_sampling.setRadiusSearch(0.1f);
uniform_sampling.filter(*cloud);*/
Eigen::Affine3f transform(Eigen::Translation3f(0.0f,0.0f,0.0f));
if (bounce_dir > 0) bounce += 0.02f;
else bounce -= 0.02f;
if (fabs(bounce) > 1.0f) bounce_dir = (bounce_dir > 0) ? -1 : 1;
Eigen::Affine3f transform(Eigen::Translation3f(bounce,0.0f,0.0f));
Eigen::Matrix4f viewPose = transform.matrix();
viewPose = inputs[0].source->getPose();
//viewPose = inputs[0].source->getPose();
LOG(INFO) << "Render vertex data";
rays.render(scene.getHashData(), scene.getHashParams(), inputs[0].gpu, viewPose);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment