[vtkusers] vtkfollower makes renderer slow when zoom-in

eclipse irocks0922 at gmail.com
Sun Dec 3 03:43:45 EST 2017


Dear VTKusers

I am trying to add vtkfollower to vtkrenderer for indicating the chosen
point.

textured vtkfollower is represented correctly, but in the renderer, if I
look closer (camera comes closer to polydata) it's getting really
slow(frame drop)

then, if I move camera far from model its rendering performance is going
back to normal.

and the boundary of image turned into black. I did not set the edge line or
something might be related.

here is the code.

why is this situation happening? Did I something in a wrong way?



m_SourceFromQrc = vtkSmartPointer<vtkQImageToImageSource>::New();
m_SourceFromQrc->SetQImage(&m_qimageFromQrc);
m_SourceFromQrc->Update();

m_spVTKTexture = vtkSmartPointer<vtkTexture>::New();
m_spVTKTexture->SetInputConnection(m_SourceFromQrc->GetOutputPort());
m_spVTKTexture->Update();

m_spVTKPlane = vtkSmartPointer<vtkPlaneSource>::New();
m_spVTKPlane->SetNormal(0.0, 0.0, 1.0);

m_spVTKTextureMappedPlane = vtkSmartPointer<vtkTextureMapToPlane>::New();
m_spVTKTextureMappedPlane->SetInputConnection(m_spVTKPlane->GetOutputPort());

m_planeDataMapper = vtkSmartPointer<vtkOpenGLPolyDataMapper>::New();
m_planeDataMapper->SetInputConnection(m_spVTKTextureMappedPlane->GetOutputPort());


double followerOriginPoint[3] = { 0.0 };
followerOriginPoint[1] = -1 / 2.0;

m_follower = vtkSmartPointer< vtkFollower>::New();
m_follower->SetOrigin(followerOriginPoint);

m_follower->SetPosition(
pos[0] - followerOriginPoint[0],
pos[1] - followerOriginPoint[1],
pos[2] - followerOriginPoint[2]);
m_follower->SetScale(6);
m_follower->SetMapper(m_planeDataMapper);
m_follower->SetTexture(m_spVTKTexture);

m_follower->SetCamera(getRenderer(m_rendererType)->GetActiveCamera());
m_follower->VisibilityOn();
m_follower->ForceOpaqueOff();
getRenderer(m_rendererType)->AddActor(m_follower);

I appreciate you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171203/0a2f3a5d/attachment.html>


More information about the vtkusers mailing list