[vtkusers] Camera movement

IvanKushnar ivan.kushnar at gmail.com
Thu Dec 13 16:13:41 EST 2012


I almost did it (the focus point still the same=(). So I get rotation instead
of translation=(

	virtual void OnKeyDown() 
	{
vtkRenderWindowInteractor *rwi = this->Interactor;
vtkSmartPointer<vtkCamera> camera;
std::string key = rwi->GetKeySym();

		if(key == "Up")
		{
double p[3];
			double loc[3]={0,0,-5};
			vtkSmartPointer<vtkTransform> tr=vtkSmartPointer<vtkTransform>::New();

			tr->Identity();
			tr->SetMatrix(camera->GetModelViewTransformObject()->GetMatrix());
			tr->Inverse();
			tr->TransformPoint(loc,p);

			camera->SetPosition(p);
			rwi->Render();
}
}



--
View this message in context: http://vtk.1045678.n5.nabble.com/Camera-movement-tp5717587p5717607.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list