0% found this document useful (0 votes)
89 views4 pages

Assignment 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views4 pages

Assignment 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CSE423: Computer Graphics

Lab Assignment 1

Important Instructions for the Assignment:

● Before starting this assignment, please ensure you have installed the

mentioned OpenGL libraries in your System.

● The skeleton code is provided for completing the tasks, or you can design

your own.

● For submission, bring the relevant py files only(no need to copy opengl

folder) in a separate folder, also paste the screenshot of different

outputs in that folder for the assignment. Rename the folder into

ID_name_labNo (ex. 17003456_md x_01), zip the folder and submit it.

Failing to follow appropriate format in submitting will yield -10% penalty.

● The deadline for submission is to be strictly maintained. Late submissions

will not be accepted.

● You must attend the lab viva for each assignment. Otherwise, you won’t

get any lab marks for that assignment.

● Any form of plagiarism will automatically cancel your assignment and will be

awarded with a -100% mark.. Please refrain from such activities.


Task 1: Building a House in Rainfall

i. Draw a house with a raindrop using the base primitives: points, lines, or
triangles. You can use ONLY GL_POINTS, GL_LINES, or
GL_TRIANGLES for designing this house. A diagram has been provided
as an example. You can modify the house design to your liking. The
rain drops should be animated to fall from top to bottom.
ii. It has been raining unwantedly for the last few days, so let’s control its
direction by designing a key that will change the direction of the rain when
clicked (slightly bending the rainfall). Design this functionality such that the
left arrow will gradually bend the rain to the left and the right arrow will
gradually bend the rain to the right.
iii. Formulate two more keys(assign whatever key you like); pressing one
will gradually change the skin colour from dark to light simulating night to
day, and the other will change it from light to dark simulating day to night .
You must also consider the rain and the house visibility in different
background colours.
Task 2: Building the Amazing Box

Design a box with the following functionalities and ensure they all work
independently and in any combination. Check out the gifs along with instructions for
better understanding.

i. The right button click on a mouse will generate random movable points
with different colours going in any random direction diagonally within a
boundary region. For instance, if a point is generated at (0,0), it can go to
(-1, 1), (-1, -1), (1,1), or (1, -1), and so on. The points should be spawned
where the right button click will be given in the box and the colour and
direction of movement should be random. The points will continue to
move in the same direction and will bounce back from the wall of the
boundary. [Bouncing from the wall can be implemented by changing
the sign of corresponding position update parameter]
ii. Pressing the “up arrow” key on the keyboard will increase the speed of all
the points generated so far and pressing the “down arrow” key on the
keyboard will decrease the speed.
iii. The left button click on a mouse will make the points blink i.e. if a point is
in red, it will go background color(here it’s black) and return to red, and this
transition should take place within a second while the transition cycle goes
on. [Think how you can easily implement this]
iv. Pressing the “Spacebar” on the keyboard should freeze all the points and
none of the above functionalities will work when frozen. The same
“Spacebar” should unfreeze them.

Above pictures don’t depict the full scenario

Submission guideline: You have to submit it in the classroom. Please follow the
submission instructions carefully. Failure to follow will be subject to a mark penalty
(20% to 50%).

You might also like