[vtkusers] recompute camera lights

Lubos Brieda lbrieda at yahoo.com
Mon Mar 26 16:57:20 EDT 2012


Hi,

I am implementing a VTK-based GUI which contains buttons to set standard views. My issue is that after the camera moves, the camera lights do not get updated until the next mouse event. This results in weird shadows. Is there some way to get the interactor/renderer to recompute the lights? Or a better way to do this? Thanks in advance!

My skeletal code is:
***
vtkCamera camera = vtk_panel.GetRenderer().GetActiveCamera();

double x0[] = camera.GetFocalPoint();
double dist = camera.GetDistance();

if (e.getSource()==camera_px_button)
{
camera.SetPosition(x0[0]+dist, x0[1],x0[2]);
camera.SetViewUp(0,1,0);
}

camera.ComputeViewPlaneNormal();
camera.OrthogonalizeViewUp();
vtk_panel.GetRenderWindow().Render();
*** 
--

Lubos
www.particleincell.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120326/d0e93c7f/attachment.htm>


More information about the vtkusers mailing list