Docsity

Primitives have Attributes-Computer Graphics-Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Primitives have Attributes-Computer Graphics-Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

HCI320: Computer Graphics^ Primitives have attributes

Primitive Attributes ^ A parameter that affects how a primitive isdisplayed is referred to as attribute parameter ^ There are various types of attributes^ ^ Colour^ ^ Size^ ^ Other display characteristics

Drawing Dashed Lines ^ Dashed or dotted lines are drawn by drawing a lineand skipping over a number of intervening pixels ^ A pixel mask may be used to decide which pixels toskip^ ^ A mask 1111000 could display a line with a dash length offour pixels and spacing of 3 pixels^ ^ The mask is loaded into the frame buffer to display theselected line type^ ^ Another method is to treat each dash as a line segment

Line Width ^ A thick line may be drawn by drawing parallel linesnext to each other ^ A parameter is set for the line width ^ A line may be drawn above and below a line for linewith width 3 for slopes less than 1 ^ There are various commands that may be used toset width of a line ^ Various types of thick lines may be drawn ^ Additional processing may be used to smooth theendpoints ^ Same mechanism may be followed for drawingcurves and ellipses

Joining lines ^ Various joints may be defined^ ^ A miter join is attained by extending outer boundaries of the twolines^ ^ A round join is produced by capping the connection between twosegments with a circular boundary with diameter equal to linewidth^ ^ A bevel join is obtained by joining the line segments and fillingthe triangular gap where the segments meet

Pen and bush option ^ A pixel mask is used to define^ ^ Shape^ ^ Size^ ^ Pattern

Electromagnetic Spectrum ^ Visible Light Frequencies Range between^ ^ Red: 4.3 x 10

14 hertz (700nm) ^ Violet: 7.5 x 10

14 hertz (400nm)

Visible Light ^ The Color of Light is Characterized by^ ^ Hue: dominant frequency (highest peak)^ ^ Saturation: excitation purity (ratio of highest to rest)^ ^ Brightness: luminance (area under curve)^ White Light

Orange Light

Color Models ^ RGB ^ XYZ ^ CMY ^ HSV ^ Others

RGB Color Model ^ Colors are Additive ^ 3 bits per pixel ^ A look-up table may beused or values added toFrame buffer

R^ G^

B^ Color 0.0^ 0.

0.0^ Black 1.0^ 0.

0.^

Red 0.0^ 1.

0.0^ Green 1.0^ 1.

0.0^ Yellow 1.0^ 0.

1.0 Magenta 0.0^ 1.

1.^

Cyan 1.0^ 1.

1.0^ White 0.0^ 0.

1.^

Blue Look-up table

CMY Color Model ^ Colors are Subtractive

C^

M^ Y^

Color 0.0^ 0.

0.0^ White 1.0^ 0.

0.^

Cyan 0.0^ 1.

0.0 Magenta 1.0^ 1.

0.^

Blue 1.0^ 0.

1.0^ Green 0.0^ 1.

1.^

Red 1.0^ 1.

1.0^ Black 0.0^ 0.

1.0^ Yellow

CMY Color Cube

HSV Color Model

H^ S^

V^ Color 0 1.^

1.0^ Red 60 1. 1.0^ Yellow 120 1.

1.0^ Green 240 1.

1.^

Blue 300 1.

1.0 Magenta* 0.0 1.0^ White* 0.0^ 0.^

Gray 180 1.

1.^

Cyan *^ *^

0.0^ Black

HSV Color Model ^ Cross Section of the HSV Hexcone