Top Banner
OUTPUT PRIMITIVES Computer Graphics
24

OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes. (points, straight line.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

OUTPUT PRIMITIVESComputer Graphics

Page 2: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

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.

Page 3: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

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.

Page 4: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

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.

Page 5: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

Scan Converting A Point

Page 6: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

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.

Page 7: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

POINT DRAWING (RASTER DISPLAY)

y

x

Page 8: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

SCAN CONVERTING A POINT (IN VECTOR DISPLAY)

x´=Floor(x) and y´=Floor(y)

All points that satisfy:

are mapped to pixel (x´,y´)

1

1

yyy

xxx

Page 9: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

Scan Converting A Line

Page 10: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

SCAN CONVERTING A LINE

The Cartesian slope- intercept equation for a straight line is:

12

12

xxyy

m

11xmyb

bxmy

xmy my

x

Page 11: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

SCAN CONVERTING A LINE These equation form the basic for

determining deflection voltage in analog devices.

xmy

|m|<1

my

x

|m|>1

Page 12: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

LINE DRAWING ALGORITHMS

x1

x2

y1

y2

Page 13: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

SCAN CONVERTING A LINE On raster system, lines are plotted

with pixels, and step size (horizontal & vertical direction) are constrained by pixel separation.

Page 14: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

SCAN CONVERTING A LINE

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

Page 15: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

Digital Differential Analyzer

(DDA Algorithm)

Page 16: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

DDA ALGORITHM Algorithm is an incremental scan

conversion method. Based on calculating either or If |m|<1,

x y

1

)1(

Y

x

myy

xmy

kK

1

Page 17: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

DDA ALGORITHM

If |m|>1, )1( x

myy

xmy

kK

1

)1( y

mxx

m

yx

kK

11

If

Page 18: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

Circle Generation Algorithms

Page 19: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

CIRCLE GENERATION ALGORITHMS

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

Page 20: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

CIRCLE GENERATION ALGORITHMS Computation can be reduced by

considering the symmetry of circles

Page 21: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

Character Generation

Page 22: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

CHARACTER GENERATION

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

Page 23: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

CHARACTER GENERATIONAttributes of characters

Page 24: OUTPUT PRIMITIVES Computer Graphics. OUTPUT PRIMITIVES Output Primitives: Basic geometric structures used to describe scenes.  (points, straight line.

CHARACTER GENERATION

There are three basic methods to generate characters,

1. Hardware based: Logic is built into the graphics terminal and drawn quickly.

2. Bitmap based: utilizes pixels and copies appropriate portion from frame buffer to display

3. Vector based: provides with unlimited possibilities with character style, size, shape