Continuous Cartesian Geometry Primitives

Whether using a retained mode or an immediate mode graphics API, the programmer must specify the geometry that the API eventually draws onto a pixel buffer. A pixel buffer is a two-dimensional array of pixels. Those pixels are most naturally referenced by integer indices.

How do you represent geometry in a graphics API? Do you use DiscreteCartesianGeometryPrimitives or ContinuousCartesianGeometryPrimitives?

One or more of these applies:

Therefore:

Represent geometry using floating point values.

Affine transformations such as scaling down or rotation will translate integer coordinates to floating point coordinates within the implementation of the API or in the graphics hardware itself. Representing geometry using floating point at the API level provides more flexibility to the user of the API.

However, floating point coordinates can introduce rounding errors. For example, 0.1 (decimal) is a recurring fraction in binary. Floating point numbers also introduce inaccuracy at the large and small scales. Some 3D APIs, such as Java3D, provide numeric types that can represent very large or very small numbers to get around this problem.


What about FixedPointCartesianGeometryPrimitives?


Also see GraphicsPatterns.

CategoryGraphicsPattern CategoryPattern


EditText of this page (last edited December 25, 2003) or FindPage with title or text search