The issue with this example is the Rotate in the pipeline causes the whole grid to move on render.
Cheers, =)
J
vtkSmartPointer<vtkActor> PointToGlyphHexagon(vtkPoints* points, double const& scale)
{
auto bounds = points->GetBounds();
double maxLen = 0;
for (int i = 1; i < 3; ++i)
{
maxLen = std::max(bounds[i + 1] - bounds[i], maxLen);
}
vtkNew<vtkCylinderSource> hexSource;
double wallSz=(scale * maxLen);
hexSource->SetHeight(wallSz);
hexSource->SetRadius(wallSz);
hexSource->SetResolution(6);
vtkNew<vtkPolyData> pd;
pd->SetPoints(points);
vtkNew<vtkGlyph3DMapper> mapper;
mapper->SetInputData(pd);
mapper->SetSourceConnection(hexSource->GetOutputPort());
mapper->ScalarVisibilityOff();
mapper->ScalingOff();
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
// actor->RotateX(90.0);
// actor->RotateY(-30.0);
return actor;
}