[vtkusers] Problem with camera position
Michele Nigri
michele.nigri at gmail.com
Wed Nov 19 06:54:08 EST 2008
Hi everyone,
when I set up my camera in a VTK app, in the rendering window I don't
see my axis actor until I interact with it, like zooming or
rotating...
This is my code:
// add renderer in the render window
renderWindow->SetSize(this->windowWidth, this->windowHeight);
renderWindow->AddRenderer(renderer);
// custom interactor
MyInteractorStyle *style = MyInteractorStyle::New();
interactor->SetRenderWindow(renderWindow);
interactor->SetInteractorStyle(style);
renderer->SetBackground(bgColor.r, bgColor.g, bgColor.b);
// create camera
vtkCamera *camera = vtkCamera::New();
camera->SetPosition(8120, 10718, 7066);
camera->SetViewUp(0, 0, 1);
renderer->SetActiveCamera(camera);
//pick event handling
PickEventCallback *pickObserver = PickEventCallback::New();
vtkPropPicker *picker = vtkPropPicker::New();
picker->AddObserver(vtkCommand::EndPickEvent, pickObserver);
interactor->SetPicker(picker);
// render an image (lights and cameras are created automatically)
// and begin mouse interaction
interactor->Initialize();
interactor->Start();
//Finalize the rendering window
renderWindow->Finalize();
Please help!!!
--
--------------------------
Cordiali saluti,
Dott.Ing. Michele Nigri
--------------------------
More information about the vtkusers
mailing list