1,vtkCylinderSource创建圆柱体默认会沿y轴方向,不能直接改变朝向,但是可以改actor的朝向
2,合并polydata没什么,可以直接合,也可以合完用vtkCleanPolyData清除掉重复的点,清楚前后效果如下


代码有点乱
int main(int, char* [])
{
vtkNew<vtkNamedColors> colors;
// Create a sphere
vtkNew<vtkCylinderSource> cylinderSource;
cylinderSource->SetCenter(0.0, 0.0, 0.0);
cylinderSource->SetRadius(5.0);
cylinderSource->SetHeight(6.0);
cylinderSource->SetResolution(100);
cylinderSource->Update();
vtkSmartPointer<vtkPolyData> poly = cylinderSource->GetOutput();
vtkIdType tuples = poly->GetPointData()->GetNumberOfTuples();
vtkFloatArray* ColorField = vtkFloatArray::New();
ColorField->SetName("ColorField");
ColorFi

最低0.47元/天 解锁文章
76

被折叠的 条评论
为什么被折叠?



