# Different positions between vtkPolyDataMapper2D and vtkPolyDataMapper

**URL:** https://discourse.vtk.org/t/different-positions-between-vtkpolydatamapper2d-and-vtkpolydatamapper/732
**Category:** Support
**Created:** [April 10, 2019, 4:05pm UTC](https://discourse.vtk.org/t/different-positions-between-vtkpolydatamapper2d-and-vtkpolydatamapper/732 "2019-04-10T16:05:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [April 10, 2019, 4:05pm UTC](https://discourse.vtk.org/t/different-positions-between-vtkpolydatamapper2d-and-vtkpolydatamapper/732/1 "2019-04-10T16:05:19Z")

</div>

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;
```
