1.4 LINE Function - Output Primitive

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 18

Computer Science III B.

Sc CS Sem : VI Year 2019 - 2020

Subject: Graphics and Multimedia

Google Classroom : oefqdki Subject Code: 63A

Output Primitives
Unit 1: Line function
Dr.M.Manimaran,
Associate Professor,
Department Computer Science,
SKACAS
oefqdki- Graphics & Multimedia Unit I Output Primitives 1
Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

SNAP TALK / ATTENDANCE

oefqdki- Graphics & Multimedia Unit I Output Primitives 2


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Lecture Agenda
• Line function

• Poly line

• PHIGS, GKS

• wcpoints

oefqdki- Graphics & Multimedia Unit I Output Primitives 3


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

EXPECTED OUTCOME
After studying this class, you should be able to:

• To understand the concepts of Line function

• To understand the concepts of Poly line

• To understand the concepts of PHIGS, GKS

• To understand the concepts of wcpoints

oefqdki- Graphics & Multimedia Unit I Output Primitives 4


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION

• A procedure for specifying straight-line segments can be


set up in a number of different forms.
• In PHIGS(Programmer's Hierarchical
Interactive Graphics Standard), GKS(Graphical
Kernel System), and some other packages, the two-
dimensional line function
• where parameter n is assigned an integer value equal to
the number of coordinate positions to be input
• wcpoints is the array of input world coordinate values
for line segment endpoints.

oefqdki- Graphics & Multimedia Unit I Output Primitives 5


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION

• This function is used to define a set of n – 1 connected


straight line segments.
• Because series of connected line segments occur more
often than isolated line segments in graphics applications,
polyline provides a more general line function

oefqdki- Graphics & Multimedia Unit I Output Primitives 6


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION

• To display a single straight-line segment, we set n -= 2


and list the x and y values of the two endpoint
coordinates.
• As an example of the use of polyline, the following
statements generate two connected line segments, with
endpoints at (50, 103, (150, 2501, and (250,100):

oefqdki- Graphics & Multimedia Unit I Output Primitives 7


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION

 wcPoints[ll .x = SO;
 wcPoints[ll .y = 100;
 wcPoints[21 .x = 150;
 wc~oints[2l.y = 250;
 wc~oints[3l.x = 250;
 wcPoints[31 .y = 100;
 polyline ( 3 , wcpoints);

oefqdki- Graphics & Multimedia Unit I Output Primitives 8


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION
• Coordinate references in the polyline function are stated as
absolute coordinate values
• For example, if location (3,2) is the last position that has been
referenced in an application program,
• a relative coordinate specification of (2, -1) corresponds to an
absolute position of (5,1).

oefqdki- Graphics & Multimedia Unit I Output Primitives 9


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

LINE FUNCTION
• Implementation of the polyline procedure is accomplished by
first performing a series of coordinate transformations, then
malung a sequence of calls to a device-level line-drawing
routine.
• In PHIGS, the input line endpoints are actually specified in
modeling coordinates, which are then converted to world
coordinates.

oefqdki- Graphics & Multimedia Unit I Output Primitives 10


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Key Points
• frame buffer addresses
• relative or absolute coordinates
• frame buffer array

oefqdki- Graphics & Multimedia Unit I Output Primitives 11


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
1) We set the line-color value in PHIGS with the
function
a) setPolylineColorIndex (lc)
b) setline Color()
c) SETPOLYLINECOLORINDEX (lc)
d) Only b

oefqdki- Graphics & Multimedia Unit I Output Primitives 12


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
2) _______ is the array of input world coordinate values
for line segment endpoints.
a) Wc points
b) setline Color()
c) Both

oefqdki- Graphics & Multimedia Unit I Output Primitives 13


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ ANSWERS
1) Answer: a
Explanation: The setPolylineColorIndex (lc)
function is used to set the line color.
2) wcpoints

oefqdki- Graphics & Multimedia Unit I Output Primitives 14


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

VIDEO URL

https://www.youtube.com/watch?v=2JIh04rHIEA

oefqdki- Graphics & Multimedia Unit I Output Primitives 15


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Next Lecture
Circle Generating Algorithms

oefqdki- Graphics & Multimedia Unit I Output Primitives 16


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

DISCUSSIONS

oefqdki- Graphics & Multimedia Unit I Output Primitives 17


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

oefqdki- Graphics & Multimedia Unit I Output Primitives 18

You might also like