# Output Primitives Computer Graphics.

## Presentation on theme: "Output Primitives Computer Graphics."— Presentation transcript:

Output Primitives Computer Graphics

Output Primitives Output Primitives: Basic geometric structures used to describe scenes. (points, straight line segment, circles and other conic sections, quadric surfaces, spline curve and surfaces, polygon color areas, and character strings) These picture components are often defined in a continuous space.

Output Primitives In order to draw the primitive objects, one has to first scan convert the object. Scan convert: Refers to the operation of finding out the location of pixels to be intensified and then setting the values of corresponding bits, in the graphic memory, to the desired intensity code.

Scan Converting A Point
A random-scan (vector) system stores point-plotting instructions in the display list, and coordinate values in these instructions are converted to deflection voltages that position the electron beam at the screen locations to be plotted during each refresh cycle.

Scan Converting A Point

Scan Converting A Point
A mathematical point P(x,y) needs to be scan converted to a pixel. If the coordinate values of point P are (3.3, 7.3) then the floor function of x’=3 and y’=7, is plotted.

Point Drawing (Raster display)
x

Scan Converting A Point (In vector display)
x´=Floor(x) and y´=Floor(y) All points that satisfy: are mapped to pixel (x´,y´)

Scan Converting A Line

Scan Converting A Line The Cartesian slope- intercept equation for a straight line is:

Scan Converting A Line These equation form the basic for determining deflection voltage in analog devices. |m|>1 |m|<1

Line Drawing Algorithms
y2 y1 x1 x2 Line Drawing Algorithms

Scan Converting A Line On raster system, lines are plotted with pixels, and step size (horizontal & vertical direction) are constrained by pixel separation.

Scan Converting A Line We must sample a line at discrete positions and determine the nearest pixel to the line at each sampled position.

Digital Differential Analyzer
(DDA Algorithm)

DDA Algorithm Algorithm is an incremental scan conversion method.
Based on calculating either or If |m|<1,

DDA Algorithm If |m|>1, If

Circle Generation Algorithms

Circle Generation Algorithms
The equation of a circle: We could solve for y in terms of x

Circle Generation Algorithms
The spacing between plotted pixel positions is not uniform.

Circle Generation Algorithms
Computation can be reduced by considering the symmetry of circles Circle Generation Algorithms

Character Generation

Character Generation Letters, numbers, and other character can be displayed in a variety of size and styles.

Character Generation Attributes of characters

Character Generation There are three basic methods to generate characters, Hardware based: Logic is built into the graphics terminal and drawn quickly. Bitmap based: utilizes pixels and copies appropriate portion from frame buffer to display Vector based: provides with unlimited possibilities with character style, size, shape