I want to change the origin of the coordinates

Hello

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

1 Attachments (28.49 MB) Expiration: 2020-12-15
Target.zip 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();

}

This may give you some ideas: TransformOrderDemo there are lots more examples here: VTK Classes used in the Examples, just search using vtktransform.