[vtkusers] Problem with camera position

Anka Kochanowska anka at bic.mni.mcgill.ca
Wed Nov 19 07:59:24 EST 2008


Hi!
renderer->ResetCamera();

Anka

Michele Nigri wrote:
> 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!!!
>
>   



More information about the vtkusers mailing list