//注意:这里的中心是0,0,0 要在ACTOR 中设置位置。
vtkNew<vtkPlaneSource> plane1; plane1->SetCenter(0,0,0); plane1->SetNormal(normal); plane1->SetResolution(1, 1); plane1->Update(); //将plane 里面的点每个都 乘以10 vtkPoints* points = plane1->GetOutput()->GetPoints(); for (int i = 0; i < points->GetNumberOfPoints(); i++) { double p[3]; points->GetPoint(i, p); p[0] *= 500; p[1] *= 500; p[2] *= 500; points->SetPoint(i, p); } vtkNew<vtkPolyDataMapper> mapper; mapper->SetInputData(plane1->GetOutput()); mapper->Update(); vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New(); actor->SetMapper(mapper); actor->SetPosition(center); actor->GetProperty()->SetColor(r, g, b); m_renderer->AddActor(actor);
标签:mapper,显示,vtkPlaneSource,大些,actor,vtkSmartPointer,points,plane1,500 From: https://www.cnblogs.com/lmao/p/18362893