Hi,<div><br></div><div>I noticed that if we use a vtkCoordinate with the <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">coordinate system set to View, and we add a ReferenceCoordinate, this one is not used.</span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">The problem is in method <span class="Apple-style-span" style="border-collapse: separate; font-family: arial; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">vtkCoordinate::<span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">GetComputedDoubleDisplayValue.</span></span></span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">here is an example to demonstrate that:</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">run it once to see the correct result then set the boolean bOk (just before main) to false to see the problem.</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">Is there a reason for that?</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><div>
<br></div><div>#include <vtk/vtkActor2D.h></div><div>#include <vtk/vtkCamera.h></div><div>#include <vtk/vtkInteractorStyleTrackballCamera.h></div><div>#include <vtk/vtkLineSource.h></div><div>#include <vtk/vtkPolyData.h></div>
<div>#include <vtk/vtkPolyDataMapper2D.h></div><div>#include <vtk/vtkProperty2D.h></div><div>#include <vtk/vtkRenderer.h></div><div>#include <vtk/vtkRenderWindow.h></div><div>#include <vtk/vtkRenderWindowInteractor.h></div>
<div>#include <vtk/vtkSphereSource.h></div><div><br></div><div>#include <vtk/vtkSmartPointer.h></div><div>#define MY_SMART(class, variable)\</div><div> vtkSmartPointer<class> variable = vtkSmartPointer<class>::New();</div>
<div><br></div><div>const double cst_dSize = 0.1;</div><div>const bool bOk = true;</div><div><br></div><div>int main(int, char* [])</div><div>{</div><div> MY_SMART(vtkRenderer, ren1);</div><div> ren1->SetBackground(0.2, 0.2, 0.2);</div>
<div> MY_SMART(vtkRenderWindow, renWin);</div><div> renWin->SetSize( 800, 800 );</div><div> renWin->AddRenderer(ren1);</div><div> MY_SMART(vtkRenderWindowInteractor, iren);</div><div> iren->SetRenderWindow(renWin);</div>
<div> MY_SMART(vtkInteractorStyleTrackballCamera, vtk_style);</div><div> iren->SetInteractorStyle(vtk_style);</div><div><br></div><div> MY_SMART(vtkLineSource, line);</div><div> line->SetPoint1(0.0, 0.0, 0.0);</div>
<div> if(bOk)</div><div> line->SetPoint2(cst_dSize, 0.0, 0.0);</div><div> else</div><div> line->SetPoint2(cst_dSize*2, 0.0, 0.0);</div><div><br></div><div> MY_SMART(vtkSphereSource, sphere1);</div><div>
sphere1->SetCenter(0.0, 0.0, 0.0);</div><div> sphere1->SetRadius(0.1);</div><div> sphere1->SetThetaResolution(16);</div><div> sphere1->SetPhiResolution(8);</div><div><br></div><div> MY_SMART(vtkSphereSource, sphere2);</div>
<div> sphere2->SetCenter(0.0, 0.0, 0.0);</div><div> sphere2->SetRadius(5);</div><div> sphere2->SetThetaResolution(16);</div><div> sphere2->SetPhiResolution(8);</div><div> </div><div> MY_SMART(vtkSphereSource, sphere3);</div>
<div> sphere3->SetCenter(0.0, 0.0, 0.0);</div><div> sphere3->SetRadius(5);</div><div> sphere3->SetThetaResolution(16);</div><div> sphere3->SetPhiResolution(8);</div><div> </div><div> MY_SMART(vtkPolyDataMapper2D, Mapper);</div>
<div> Mapper->SetInputConnection(line->GetOutputPort());</div><div> MY_SMART(vtkPolyDataMapper2D, Mappers1);</div><div> Mappers1->SetInputConnection(sphere1->GetOutputPort());</div><div> MY_SMART(vtkPolyDataMapper2D, Mappers2);</div>
<div> Mappers2->SetInputConnection(sphere2->GetOutputPort());</div><div> MY_SMART(vtkPolyDataMapper2D, Mappers3);</div><div> Mappers3->SetInputConnection(sphere3->GetOutputPort());</div><div><br></div><div>
MY_SMART(vtkActor2D, Act);</div><div> Act->GetProperty()->SetColor(0.0, 1.0, 1.0);</div><div> Act->GetProperty()->SetLineWidth(5);</div><div> Act->SetMapper(Mapper);</div><div> MY_SMART(vtkActor2D, Acts1);</div>
<div> Acts1->GetProperty()->SetColor(1.0, 0.0, 0.0);</div><div> Acts1->SetMapper(Mappers1);</div><div> MY_SMART(vtkActor2D, Acts2);</div><div> Acts2->GetProperty()->SetColor(0.0, 1.0, 0.0);</div><div>
Acts2->SetMapper(Mappers2);</div><div> MY_SMART(vtkActor2D, Acts3);</div><div> Acts3->GetProperty()->SetColor(0.0, 0.0, 1.0);</div><div> Acts3->SetMapper(Mappers3);</div><div><br></div><div> MY_SMART(vtkCoordinate, coord);</div>
<div> coord->SetCoordinateSystemToWorld();</div><div> Mappers1->SetTransformCoordinate(coord);</div><div><br></div><div> Acts2->GetPositionCoordinate()->SetCoordinateSystemToWorld();</div><div> Acts2->GetPositionCoordinate()->SetValue(0.0, 2.0, 0.0);</div>
<div><br></div><div> Acts3->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();</div><div> Acts3->GetPositionCoordinate()->SetValue(0.1, 0.0, 0.0);</div><div><br></div><div> MY_SMART(vtkCoordinate, pCoord);</div>
<div> pCoord->SetCoordinateSystemToWorld();</div><div> pCoord->SetValue(0.0, 2.0, 0.0);</div><div> Acts3->GetPositionCoordinate()->SetReferenceCoordinate(pCoord);</div><div><br></div><div> MY_SMART(vtkCoordinate, coo);</div>
<div> if(bOk)</div><div> coo->SetCoordinateSystemToNormalizedViewport();</div><div> else</div><div> coo->SetCoordinateSystemToView();</div><div> coo->SetReferenceCoordinate(pCoord);</div><div> Mapper->SetTransformCoordinate(coo);</div>
<div><br></div><div> ren1->AddActor2D(Act);</div><div> ren1->AddActor2D(Acts1);</div><div> ren1->AddActor2D(Acts2);</div><div> ren1->AddActor2D(Acts3);</div><div><br></div><div> ren1->ResetCamera();</div>
<div> ren1->GetActiveCamera()->ParallelProjectionOn();</div><div> ren1->GetActiveCamera()->Zoom(0.4);</div><div> renWin->Render();</div><div> iren->Start();</div><div><br></div><div> return 0;</div>
<div>}</div><div><br></div></span></font></div>