0% found this document useful (0 votes)
65 views1 page

CG Lab Chapter 2

This document describes three computer graphics lab exercises that allow user interaction through a mouse. The first allows drawing rectangles by clicking at opposite corners. The second controls a Sierpinski gasket where the user specifies the vertices of an initial triangle with mouse clicks. The third draws either a triangle or square at the mouse position depending on whether the left or right button is pressed.

Uploaded by

syma masood
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views1 page

CG Lab Chapter 2

This document describes three computer graphics lab exercises that allow user interaction through a mouse. The first allows drawing rectangles by clicking at opposite corners. The second controls a Sierpinski gasket where the user specifies the vertices of an initial triangle with mouse clicks. The third draws either a triangle or square at the mouse position depending on whether the left or right button is pressed.

Uploaded by

syma masood
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

CG Lab Chapter 2

1. Draw rectangles whose dimensions are entered with the mouse left click. The user clicks the mouse at two points which specify opposite corners of rectangle, and the rectangle is drawn. The user can clear the screen by pressing the right mouse button. 2. Control the sierpinski gasket by mouse, so that user can specify 3 vertices of the initial parent triangle with the mouse. 3. Each time the user presses down the left mouse button a fixed size triangle is drawn in the screen window at the mouse position and whenever user presses the right mouse button a fixed size square is drawn of different color than the color of triangle.

You might also like