0% found this document useful (0 votes)
13 views

ICS2311_Assignment_on_transformations_and_shapes

The document outlines the requirements for an ICS2311 CAT on transformations and shapes due on March 13th at 5 PM. It includes specific tasks involving OpenGL programming, such as drawing shapes like circles, triangles, ellipses, squares, and polygons, along with applying transformations and color fills. Students are expected to submit their individual work via email, ensuring all drawings are labeled and OpenGL codes are organized and commented.

Uploaded by

iamkarue
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

ICS2311_Assignment_on_transformations_and_shapes

The document outlines the requirements for an ICS2311 CAT on transformations and shapes due on March 13th at 5 PM. It includes specific tasks involving OpenGL programming, such as drawing shapes like circles, triangles, ellipses, squares, and polygons, along with applying transformations and color fills. Students are expected to submit their individual work via email, ensuring all drawings are labeled and OpenGL codes are organized and commented.

Uploaded by

iamkarue
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ICS2311 CAT on transformations and shapes – due 13th march 5pm

Send to [email protected] with subject as MARCHCAT1:ICS2311:


Your name

1. Ensure that all your drawings have coordinates (x.y) labelled and scaled
2. Zip all your OpenGL codes and for each program clearly label the codes
even at the comment sections
3. Individual work is expected

QUESTION 1- Circle Drawing and triangle


a) Using OpenGL, write a program that draws a circle
using Brensenham circle drawing algorithm: The parameters for the circle
are as follows – the radius should be 4 Centimeters and the starting point
coordinates are (1,1)

(i) write an OpenGL program to rotate the Circle 60


degrees clockwise and fill it with red shade (hint RGB # hex
ff0000)

b) Using OpenGL, Write a program to draw a triangle with vertices (-


1,6 ; 2,0; -4,9)
i)Draw a Circle round the triangle (Circumscribed)-the
circle should be in red color

QUESTION 2- Ellipse drawing


a) Using Open GL and midpoint ellipse algorithm, draw an ellipse with centre
as (1,2) given by

i) Apply the flood-fill algorithm in OpenGL to fill the interior of the


above ellipse with orange color (#FFA500)

QUESTION 3- SQUARE drawing


a)Using OpenGL Draw a square with coordinate points A(0, 4), B(3, 4),
C(4, 0), D(0, 0).

(i) Apply the translation with distance 2 towards X axis


and 2 towards Y axis. Obtain the new coordinates of the
square.
(ii) write an OpenGL program to rotate the translated
figure with rotation angle = θ = 55º

QUESTION 4- Polygon drawing


a) Using OpenGL draw a filled polygon with the following dimensions
(8,4;2,4;0,8;3,12;7,12;10,8) hint (GL POLYGON function) might be
useful

(i). Write a function in OpenGL to fill the polygon above


in Red color
(#FF0000.)
(ii). Write OpenGL program to scale up (scaling) the polygon by
a factor of 2

(ii) Write a procedure in OpenGL to fill the interior of the given


polygon above with shades of green asterisks

QUESTION 5-PARABOLA Drawing

a) Use the midpoint method and symmetry considerations to scan convert the
parabola
x=y2 for the interval - 10 ≤ y ≤10

Show the working of the method and implement it using OpenGL

You might also like