[vtkusers] 3D model and 2d Image overlay - depth issues, flickering

manikandtan.ck manikandtan.ck at gmail.com
Thu Nov 7 01:07:48 EST 2013


rw->SetWindowId(hWnd);   * //rw is vtkWin32OpenGLRenderWindow*
rw->SetParentId(hWnd);
rw->SetDeviceContext(hDC);
rw->SetContextId(hRC);
rw->SetSize(rect.Width(), rect.Height());
ren->SetLayer(0);    *//ren and ren2 are the renderers*
ren->InteractiveOn();
ren2->SetLayer(1);
ren2->InteractiveOff();
rw->SetNumberOfLayers(2);
rw->AddRenderer(ren);
rw->AddRenderer(ren2);
iren->SetRenderWindow(rw); *//iren is the render window interactor*

*////vtkvolume  and vtkImageActor  are created here*

ren->RemoveAllViewProps();
ren2->RemoveAllViewProps();

ren->AddActor(volume); *///volume is a vtkVolume*
ren2->AddActor(imageActorax);  */// imageActorax is a vtkImageActor*

rw->Render();

camera = ren->GetActiveCamera();

camera->SetFocalPoint(c[0], c[1], c[2]); *///c[3] is center of volume*
camera->SetPosition(c[0] + 500, c[1], c[2]);
camera->Azimuth(90);

camera2 = ren2->GetActiveCamera();

camera2->SetFocalPoint(c[0], c[1], c[2]);
camera2->SetPosition(c[0] + 500, c[1], c[2]);
camera2->Azimuth(90);

iren->EnableRenderOn();
iren->SetInteractorStyle(style); *///style is
vtkInteractorStyleTrackballCamera*
style->EnabledOn();
style->On();

rw->GlobalWarningDisplayOff();
ren->GlobalWarningDisplayOff();
iren->GlobalWarningDisplayOff();

rw->Render();

iren->Initialize();




--
View this message in context: http://vtk.1045678.n5.nabble.com/3D-model-and-2d-Image-overlay-depth-issues-flickering-tp5724298p5724343.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list