Skip to content

Commit

Permalink
Fix bug in renderViewTesselatedSphere
Browse files Browse the repository at this point in the history
Loopsubdivision will not guarantee new vertices stay on unit sphere,
so we should normalize the coordinates.
  • Loading branch information
Tonsty committed Dec 15, 2014
1 parent fe33c8f commit 964c025
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,7 @@ pcl::visualization::PCLVisualizer::renderViewTesselatedSphere (
sphere->GetPoint (ptIds_com[2], p3_com);
vtkTriangle::TriangleCenter (p1_com, p2_com, p3_com, center);
cam_positions[i] = Eigen::Vector3f (float (center[0]), float (center[1]), float (center[2]));
cam_positions[i].normalize ();
i++;
}

Expand All @@ -3426,6 +3427,7 @@ pcl::visualization::PCLVisualizer::renderViewTesselatedSphere (
double cam_pos[3];
sphere->GetPoint (i, cam_pos);
cam_positions[i] = Eigen::Vector3f (float (cam_pos[0]), float (cam_pos[1]), float (cam_pos[2]));
cam_positions[i].normalize ();
}
}

Expand Down

0 comments on commit 964c025

Please sign in to comment.