DG Kernel Documentation

Skip Navigation Links.
Skip Navigation LinksHome Page > Graphics > Eye Frame Search Documentation

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 relative to the global frame.

Another important element 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. The Viewing Plane should be imagined as an infinite plane in 3D space parallel to the plane of computers screen.

In the default view configuration, presented on start, Viewing Plane contains origin of the global frame. So normally it intersects with objects in the scene. It is not a problem as rendering involves only mathematical processing of coordinates, where intersections do not matter.

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) is being rotated instead. 

Experiment with Birds Eye view to see the above elements in action: Start any sample. Click on the DGK window. Press v,b. Try rotate/pan/zoom in the main window of the sample and observe how it affects the elements of the scene.

Programmatically the viewing frame can be accessed and manipulated with the help of IFrame_DG  interface obtained on path: DG Kernel > GetView() > IView_DG > GetEyeFrame() > IFrame_DG. Coordinates of different attributes obtained using the IFrame_DG are relative to the global axes.

Frequently it is convenient to (make appearance of) translate or rotate the global frame with respect to the Eye frame. IFrame_DG, which allows that, can be obtained by executing Clone() > Invert() on the IFrame_DG obtained above.

To change coordinates of a point or vector from global frame to Eye Frame obtain IFrame_DG of the Eye Frame as described above and call IFrame_DG.ToLocal*(). To make the inverse conversion from Eye Frame coordinates to global coordinates use IFrame_DG.ToGlobal*().

IView_DG provides convenient shortcuts for point of view and zoom manipulation. 

See also Viewing Interfaces, Manipulation of point of view