医疗软件Pan、Zoom、Rotation的实现原理

Pan、Zoom、Rotation调节的实现其实都是修改vtkCamera的参数,具体为Pan 修改的是相机的焦点参数,Zoom修改的是相机的位置参数,Rotation修改的是相机的ViewUp参数。
以下是对vtkCamera的一点介绍:
观众的眼睛就好比三维渲染场景中的相机,VTK则是用vtkCamera类来表示三维渲染场景中的相机。vtkCamera负责把三维场景投影到二维平面,如屏幕、图像等。下图为相机投影示意图。

以下是vtkCamera文档中对相机运动方式的解释
void vtkCamera::Roll ( double angle )
Rotate the camera about the direction of projection. This will spin the camera about its axis.

void vtkCamera::Azimuth ( double angle )
Rotate the camera about the view up vector centered at the focal point. Note that the view up vector is whatever was set via SetViewUp, and is not necessarily perpendicular to the direction of projection. The result is a horizontal rotation of the camera.

void vtkCamera::Yaw ( double angle )
Rotate the focal point about the view up vector, using the camera’s position as the center of rotation. Note that the view up vector is whatever was set via SetViewUp, and is not necessarily perpendicular to the direction of projection. The result is a horizontal rotation of the scene.

void vtkCamera::Elevation ( double angle )
Rotate the camera about the cross product of the negative of the direction of projection and the view up vector, using the focal point as the center of rotation. The result is a vertical rotation of the scene.

void vtkCamera::Pitch ( double angle )
Rotate the focal point about the cross product of the view up vector and the direction of projection, using the camera’s position as the center of rotation. The result is a vertical rotation of the camera.

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2017年6月27日
下一篇 2017年6月27日

相关推荐