Resolution independent coordinate systems

Graphics are not pixelbased, but use world-coordinate units where each unit is 1/72 of an inch to equal 1 point. A point is the unit of measurement used by printers, graphic designers, and type setters.

If you create a line with a length of 72 coordinate units, it is rendered one inch long regardless of the resolution of the device. Resolution independence means that the resolution of the device is not exposed, and in general, you can go to any screen or printer of any resolution without writing additional code.

World-coordinate units enable you to run an application program on any type of hardware that has a graphics device driver defined for it based on the CommonPoint device classes. The 2D geometry classes use x- and y-axes in world-coordinate units. The 3D geometry classes use x-, y-, and zaxes in world-coordinate units.

As shown in the figures that follow, the 2D coordinate system is lefthanded (yaxis going down), and the 3D coordinate system is righthanded (y-axis going up). The lefthanded 2D coordinate system is used because a typical document page starts at the top and extends downward.

Twodimensional coordinate system

Positive world-coordinate units along the x-axis lie to the right of the origin and positive world-coordinate units along the y-axis lie below the origin. The 2D coordinate system can be changed by drawing into a TLinkedModelMatrixPort with a reflection matrix as described in Chapter 19.

Figure 1 shows the 2D coordinate system. The grid lines represent where points in world-coordinate units lie. For example, the point (5, 3) is five grid lines in the positive x direction, and three grid lines in the positive y direction. The pixels are positioned in the spaces between the grid lines. If you have, for example, a monitor that is 72 dpi, there is one pixel within each space, and if the monitor is 144 dpi, there are two pixels within each space.

The position of the origin (0,0) is in the upper-left corner of the view.


Threedimensional coordinate system

By default and as shown inFigure 2, positive world-coordinate units along the xaxis lie to the right of the origin; positive world-coordinate units along the yaxis lie above the origin; positive world-coordinate units along the z-axis lie out from the origin towards the viewer. The grid lines represent where points in world-coordinate units lie. For example, the point (9, 0, 3) is nine grid lines in the positive x direction, 0 lines in the positive y direction, and three lines in the positive z direction. The pixels are positioned in the spaces between the grid lines in the x-y plane. If you have, for example, a monitor that is 72 dpi, there is one pixel within each space, and if the monitor is 144 dpi, there are two pixels within each space.

By default, the position of the origin (0, 0, ) is the middle of the view. You can change the 3-D coordinate system by drawing into a TLinkedModelMatrix3DPort with a reflection matrix as described in Chapter 19.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker