Introduction To Computer Graphics and Visualization
Introduction To Computer Graphics and Visualization
• A line from (x1, y1) to (x2, y2) is therefore drawn using the two calls moveto(x1,
y1);lineto(x2,y2). A polyline based on the list of points (x0 , y 0), (x1, y1), ... , (xn-
1, yn-1) is easily drawn
• the y-value of the mouse position is the number of pixels from the top of
the screen window, we draw the dot, not at (x, y), but at (x, screenHeight –
y), where screenHeight is assumed here to be the height of the window in
pixels.
Practice Question
• Specifying a rectangle with the mouse
• Create a polyline using the mouse
• “Freehand” drawing with a fat brush***
Case Study
• Pseudo random Clouds of Dots
• Polyline Editor.