Vtk Pipeline
a. Camera => 你看物體的眼睛視窗
b. Azimuth => 設定 Camera 的角度,也就是跟正交的方位角夾角,你可以變更看看
c. Viewport: {(.0, .0)~(1.0, 1.0)}
d. 連到 http://horse.nchc.org.tw/IvI3,隨便找一個 Model 看看。
2. _VTK_Process.cxx => ModelToImage()
你可以查閱 mdl2img.h => 可以得到所有的 function 的 prototype
3. 如何去恰當地使用SetViewport函式呢,讓物體如一個cone,可以按照想要呈現的方式(如和視角呈現45度的夾角),出現在2d平面之中,而SetViewport((0.0,0.0)~(1.0,1.0))是指何意義呢
3.0 Object Models
There are two distinct parts to our object design. The first is the graphics model, which is an abstract model for 3D graphics. The second is the visualization model, which is a data-flow model of the visualization process.
3.1 The Graphics Model
The graphics model captures the essential features of a 3D graphics system in a form that is easy to understand and use. The abstraction is based on the movie-making industry, with some influence from current graphical user interface (GUI) windowing systems.There are nine basic objects in the model.
- Render Master - coordinates device-independent methods and creates rendering windows.
- Render Window - manages a window on the display device. One or more renderers draw into a render window to generate a scene (i.e., final image).
- Renderer - coordinates the rendering of lights, cameras, and actors.
- Light - illuminates the actors in a scene.
- Camera - defines the view position, focal point, and other camera characteristics.
- Actor - an object drawn by a renderer in the scene. Actors are defined in terms of mapper, property, and a transform objects.
- Property - represents the rendered attributes of an actor including object color, lighting (e.g., specular, ambient, diffuse), texture map, drawing style (e.g., wireframe or shaded); and shading style.
- Mapper - represents the geometric definition of an actor and maps the object through a lookup table. More than one actor may refer to the same mapper.
- Transform - an object that consists of a 4x4 transformation matrix and methods to modify the matrix. It specifies the position and orientation of actors, cameras, and lights.
vtk pipeline:
1. Data->Filter->Actor->Camera->Renderer->Lights->Render window
2. Mapper->Properties
3. The basic setup procedure in most VTK programs is: source -> mapper -> actor -> renderer -> renderwindow.
2. VTK uses a command/observer design pattern. That is, observers watch for particular events that any vtkObject (or subclass) may invoke on itself. For example, the vtkRenderer invokes a "StartEvent" as it begins to render. Here we add an observer that invokes a command when this event is observed.
rendrr.AddObserver("StartEvent", myCallback)
3. Specify a vtkViewport object to be used to transform the vtkPolyData points into 2D coordinates. By default (no vtkViewport specified), the point coordinates are generated by ignoring the z values. If a viewport is defined, then the points are transformed into viewport coordinates.