<div dir="ltr"><div><div>Actually, with perspective projection it seems quite okay. See attached screenshot.<br><br></div>So is this a limitation with vtkCubeAxesActor? It doesn't like parallel projection?<br><br></div>Elvis<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-04 21:13 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>While doing some experimenting, I encountered a strange behavior with vtkCubeAxesActor.<br><br></div>The setup I had was this:<br><br><br>SampleWidget::SampleWidget(QWidget *parent, Qt::WindowFlags flags)<br>    : VTKWidget(parent, flags)<br>{<br>    auto renderer = vtkSmartPointer<vtkRenderer>::New();<br>    renderer->SetBackground(1.0, 1.0, 1.0);<br><br>    auto reader = vtkSmartPointer<HDF5ImageReader>::New();<br>    reader->setFileName("/home/estan/testvolume.hdf5");<br>    reader->setDataSetName("reconstruction");<br><br>    auto volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();<br>    volumeMapper->SetInputConnection(reader->GetOutputPort());<br><br>    auto volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();<br>    volumeProperty->SetInterpolationTypeToLinear();<br>    volumeProperty->ShadeOff();<br><br>    auto opacity = vtkSmartPointer<vtkPiecewiseFunction>::New();<br>    opacity->AddPoint(0.0,1.0);<br>    opacity->AddPoint(1.0,1.0);<br>    volumeProperty->SetScalarOpacity(opacity);<br><br>    auto color = vtkSmartPointer<vtkColorTransferFunction>::New();<br>    color->AddRGBPoint(0.0,1.0,1.0,1.0);<br>    color->AddRGBPoint(1.0,0.0,0.0,0.0);<br>    volumeProperty->SetColor(color);<br><br>    auto volume = vtkSmartPointer<vtkVolume>::New();<br>    volume->SetMapper(volumeMapper);<br>    volume->SetProperty(volumeProperty);<br>    renderer->AddVolume(volume);<br><br>    auto camera = renderer->GetActiveCamera();<br>    camera->SetParallelProjection(true);<br><br>    auto cubeAxesActor = vtkSmartPointer<vtkCubeAxesActor>::New();<br>    cubeAxesActor->SetFlyModeToOuterEdges();<br>    cubeAxesActor->SetBounds(volume->GetBounds());<br>    cubeAxesActor->SetCamera(renderer->GetActiveCamera());<br>    cubeAxesActor->GetTitleTextProperty(0)->SetColor(1.0, 0.0, 0.0);<br>    cubeAxesActor->GetLabelTextProperty(0)->SetColor(1.0, 0.0, 0.0);<br>    cubeAxesActor->GetTitleTextProperty(1)->SetColor(0.0, 1.0, 0.0);<br>    cubeAxesActor->GetLabelTextProperty(1)->SetColor(0.0, 1.0, 0.0);<br>    cubeAxesActor->GetTitleTextProperty(2)->SetColor(0.0, 0.0, 1.0);<br>    cubeAxesActor->GetLabelTextProperty(2)->SetColor(0.0, 0.0, 1.0);<br><br>    renderer->AddActor(cubeAxesActor);<br><br>    renderer->ResetCamera();<br><br>    GetRenderWindow()->AddRenderer(renderer);<br>}<br><br></div>And I got the attached result. Notice how the axis labels don't quite line up with the bounding box edge of my volume, and how numbers further away are much larger (!) than numbers closer to the camera.<br><br></div>If I don't turn on parallell projection on the camera, the effect is less noticable, but still there: The numbers are all the same size, but the labels still don't line up with the bounding box edges properly.<br><br></div>Anyone have an idea what's the problem could be?<br><br></div>Thanks in advance,<br></div>Elvis<br><br></div>
</blockquote></div><br></div>