Professional Documents
Culture Documents
3) CSE202 - Unit I - Part 3
3) CSE202 - Unit I - Part 3
3) CSE202 - Unit I - Part 3
22/11/2022
Graphics Output Primitives
• Coordinate Reference Frames
• Specifying A 2D World-Coordinate Reference Frame
• OpenGL Point Functions
• OpenGL Line Functions
• OpenGL Curve Functions
• Line Drawing Algorithms
• where the asterisk (*) indicates that suffix codes, the numerical data
type to be used
• Vector
• There are six different symbolic constants that we can use as the
argument in the glBegin function to describe polygon fill areas
22/11/2022 Ref: Computer Graphics with OpenGL by Donald D. Hearn et al., 13
Polygon Functions(Contd.)
• A polygon vertex list must contain at least three vertices. Otherwise,
nothing is displayed.
• We can determine values for the slope “m” and “y” intercept “b” with
the following calculations:
• Case 1:
• Case 2:
• Case 3:
22/11/2022 20
DDA Line Drawing Algorithm
• Digital Differential Analyzer (DDA)
• Lines are to be processed from the left end point to the right end
point
• Case 1: If the slope is less than or equal to 1
• δx=1 and compute successive y values
• Using a fixed angular step size, a circle is plotted with equally spaced
points along the circumference
• The trigonometric calculations are still time-consuming
• Any point (x, y) on the boundary of the circle with radius “r” satisfies
the equation fcirc(x, y) =0.
• Polar form
• Similarly P2k+1,P20
22/11/2022 69