# I want to change the origin of the coordinates

**URL:** https://discourse.vtk.org/t/i-want-to-change-the-origin-of-the-coordinates/4661
**Category:** Support
**Tags:** doxygen, jobs, training, proposal, file-formats
**Created:** [November 15, 2020, 1:00pm UTC](https://discourse.vtk.org/t/i-want-to-change-the-origin-of-the-coordinates/4661 "2020-11-15T13:00:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Seram](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seram/32/1783_2.png) [@Seram](https://discourse.vtk.org/u/Seram)
#### Post date: [November 15, 2020, 1:00pm UTC](https://discourse.vtk.org/t/i-want-to-change-the-origin-of-the-coordinates/4661/1 "2020-11-15T13:00:18Z")

</div>

Hello

I want to change the origin of the coordinates, not change the viewing direction.

 ![이미지 593](https://discourse.vtk.org/uploads/default/original/2X/2/2bf480cba4ff5cac436b91441680f1432a75110b.jpeg)

**1**  **Attachments** (28.49 MB) **Expiration:**  **2020-12-15**  
[Target.zip](https://service1.officeplugin.com:443/outlook/downloadFile2?f=e6adc544d0ac4f4f8787c457574a9995) 28.49 MB

I want to switch from left to right.  
What should I do?

I tried using m\_vtkRenderer-\>GetActiveCamera()-\>SetViewUp(0, -1, 0),  
but it wasn’t what I wanted

void CVTK3DWindow::UpdatePointerToWindow()  
{  
CString tmp;  
int numPoints = m\_vtkPCDPoints-\>GetNumberOfPoints();  
if (numPoints == 0)  
return;

```
double bounds[6];
m_vtkPCDPoints->GetBounds(bounds);
double minz = bounds[4];
double maxz = bounds[5];

vtkNew<vtkLookupTable> lut;
CreateLookupTable(minz, maxz, numPoints, &lut);

vtkNew<vtkUnsignedCharArray> colors;
CreateScalars(m_vtkPCDPoints, lut, &colors);

m_vtkScalarBar->SetLookupTable(lut);
m_vtkScalarBar->SetNumberOfLabels(6);
m_vtkScalarBar->SetBarRatio(0.1);
m_vtkScalarBar->SetHeight(0.3);
m_vtkScalarBar->SetTextPad(10);
m_vtkScalarBar->SetTextPositionToPrecedeScalarBar();
//m_vtkScalarBar->GetLabelTextProperty()->SetFontSize(100);

m_vtkPolydata->SetPoints(m_vtkPCDPoints);
m_vtkPolydata->GetPointData()->SetScalars(colors);

m_vtkGlyphFilter->SetInputData(m_vtkPolydata);
m_vtkGlyphFilter->Update();

m_vtkMapper->SetInputConnection(m_vtkGlyphFilter->GetOutputPort());
m_vtkMapper->SetScaleFactor(0);
m_vtkMapper->EmissiveOff();

m_vtkActor->SetMapper(m_vtkMapper);

m_vtkRenderer->AddActor(m_vtkActor);
m_vtkRenderer->AddActor(m_vtkScalarBar);
m_vtkRenderer->SetBackground(.1, .2, .3);
m_vtkRenderer->ResetCamera();

m_vtkRenderWindowInteractor->SetRenderWindow(m_vtkRenderWindow);
m_vtkRenderWindowInteractor->Initialize();

m_vtkStyle->SetDefaultRenderer(m_vtkRenderer);
m_vtkStyle->SetParent(this);

m_vtkRenderWindowInteractor->SetInteractorStyle(m_vtkStyle);
m_vtkRenderWindowInteractor->Initialize();

m_vtkRenderWindow->AddRenderer(m_vtkRenderer);
m_vtkRenderWindow->Render();

```

}

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [November 16, 2020, 7:29am UTC](https://discourse.vtk.org/t/i-want-to-change-the-origin-of-the-coordinates/4661/2 "2020-11-16T07:29:40Z")

</div>

This may give you some ideas: [TransformOrderDemo](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/TransformOrderDemo/) there are lots more examples here: [VTK Classes used in the Examples](https://kitware.github.io/vtk-examples/site/Cxx/Coverage/CxxVTKClassesUsed/), just search using `vtktransform`.
