Computer Graphics Elements (Primitives)
Computer Graphics Elements (Primitives)
(Primitives)
Lecture 2
Introduction
• How output primitives of graphics images appear?
• The primitives are:
- Polylines
- Text
- filled regions
• All other graphic elements are built from these primitives.
Polylines
• A polyline is a connected sequence of straight lines.
• To the eye, a polyline can appear as a smooth curve.
• Simple polyline attributes are colour and thickness.
• The simplest polyline is a single straight line segment.
• A line segment is specified by its two endpoints, such as
(x1, y1) and (x2, y2).
• When there are several lines in a polyline, each one is called
an edge, and two adjacent lines meet at a vertex.
• The edges of a polyline can cross one another but a polyline
does not have to be closed.
• A polygon has its first and last points connected by an edge.
• If no two edges cross, the polygon is called a simple polygon.
• An example of a polyline is shown in figure (a), and a polygon
is shown in figure (b) below:
Polylines