Hi
I have a spline and i want to transform it in polydata. If i do it in 3d it works perfect but then i use the viewer, it only renders it in the slice corresponding to its z. And i want to have it in every slice. To do this,
I used the vtkPolyDataMapper2D instead. And i found the points in places that do not make sense. I have tried the vtkcoordinates and all options but with no success. Do you know how i can convert the points so that i can get the same positions as vtkPolyDataMapper in 3d?
Thank you
spline_curve->SetPoints(new_points);
for (int i = 0; i < new_points->GetNumberOfPoints(); i++) {
double pts1[3];
double pts2[3];
new_points->GetPoint(i, pts1);
pts2[0] = pts1[0];
pts2[1] = pts1[1];
pts2[2] = 0;
new_points->SetPoint(i, pts2);
}
vtkSmartPointer<vtkPolyData> polydata =
vtkSmartPointer<vtkPolyData>::New();
polydata->SetPoints(new_points);
vtkSmartPointer<vtkVertexGlyphFilter> glyphFilter =
vtkSmartPointer<vtkVertexGlyphFilter>::New();
glyphFilter->SetInputData(polydata);
glyphFilter->Update();
//vtkCoordinate *coor = vtkCoordinate::New();
//coor->SetCoordinateSystem(5);
vtkSmartPointer<vtkPolyDataMapper2D> mapper =
vtkSmartPointer<vtkPolyDataMapper2D>::New();
mapper->SetInputConnection(glyphFilter->GetOutputPort());
mapper->Update();
return mapper;