Home Page > KernelCAD Models > Basics of 3D Graphics > Viewing Plane
ModelView Transformations
Global and Eye Coordinate Systems
Global frame (Global axes of coordinates) is the unique universal system of coordinates with which the
real 3D space is modelled. Positions of objects and orientation of their local
frames are determined with respect to global frame.
Another important element used in DInsight graphical software is the
Viewing
Plane. Viewing Plane represents plane of the computer screen.. Objects in the space are
projected to the Viewing Plane thus creating a 2D image, which than mapped to the
pixels of the physical screen. So the Viewing Plane should be imagined as an
infinite plane in 3D space parallel to the plane of computers screen.
The Viewing Plane has a standard system of coordinates associated with it.
Its x and y axes lie in the Viewing Plane. Its z axis is directed toward the
viewer. This system of coordinates is called Eye Frame (or Eye
Coordinate System). X axis of the Eye Frame is directed horizontally to the
right relative to the screen. Y axis is directed vertically up. Location of the
origin of the Eye Frame is changing constantly during viewing transformations.
Note that the Eye Frame term means only that its z axis is aligned with the
line of view. Origin of the frame is frequently located inside the model.
Orientation of the viewing frame changes when viewer performs
Viewing Transformations with the mouse in any 3D window. Because the image
observed on the screen is result of projection to the Viewing Plane it appears
that the Viewing Plane is static but the global frame ( and the model along with
it) is being rotated instead.
Programmatically
the viewing frame can be accessed and manipulated with the help of IFrame
interface obtained on path: KernelCAD > GetView()
> IPropertyArray > GetProperty("EyeFrame",..)
> IFrame. Coordinates of different attributes
obtained from of this IFrame are relative to the global axes.
Frequently it is convenient to translate or rotate the global frame with
respect to the Eye frame. IFrame, which allows
that, can be accessed via path: KernelCAD > GetView()
> IView
> IFrame.
To change coordinates of a point from global frame to Eye Frame obtain IFrame
of the Eye Frame as above and call IFrameEx.ToLocal.
To make inverse conversion. from Eye Frame coordinates to global coordinates use
IFrameEx.ToGlobal for the same interface.
IFrame of the global axes and IFrame of Eye Frame are dual in the sense that
coordinates of a point local to one of them are the global coordinates of the
same point relative to the other one.
ILook
gives a simplified interface to the point of view and current zoom manipulation.
See also Viewing Interfaces,
Manipulation of point of view
|