CMSC 427 Computer Graphics Problem Set 0 - Prof. David Jacobs, Assignments of Computer Graphics

A problem set for a computer graphics course, cmsc 427. The problem set, assigned in february 2005, introduces opengl programming and requires students to modify a simple opengl program to display a square, accept keyboard and mouse input to change color and shape, and implement drag-and-drop functionality.

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-fia
koofers-user-fia 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Problem Set 0
CMSC 427 – Computer Graphics
Assigned February 1, 2005
Due February 8, 2005
This problem set will introduce OpenGL programming. You will start with a simple,
working OpenGL program and modify it. The source code for this problem is available
from the class web page.
1. 25 points. Modify the program so that instead of displaying a triangle, it displays
a square.
2. 12.5 points. Now modify your program to accept keyboard input. Your program
should allow the user to change the color of the square, by pressing the r (red), g
(green), or b (blue) keys.
3. 12.5 points. Now modify your program so that it accepts input from the mouse.
If the user right clicks the mouse, with the mouse over the square, turn the square
into a diamond.
4. 50 points. Now we will modify the program to allow more continuous user input
so that the user can drag the square around. Modify your program so that if the
user left clicks the mouse while the mouse is on top of the square, and then holds
the mouse button down and drags the mouse, then the square will be dragged by
the mouse.
a. As the square is being dragged, the mouse pointer should remain over the
same point on the square as it was when the mouse was initially clicked.
As the mouse is moving, the square should move continuously with the
mouse.
b. If the user clicks the left mouse button with the mouse outside of the
square and then drags the mouse, the square should not move, even if the
mouse is dragged over the square.
You do not have to worry about dragging a diamond that might be produced by a
right mouse click.

Partial preview of the text

Download CMSC 427 Computer Graphics Problem Set 0 - Prof. David Jacobs and more Assignments Computer Graphics in PDF only on Docsity!

Problem Set 0

CMSC 427 – Computer Graphics

Assigned February 1, 2005

Due February 8, 2005

This problem set will introduce OpenGL programming. You will start with a simple, working OpenGL program and modify it. The source code for this problem is available from the class web page.

  1. 25 points. Modify the program so that instead of displaying a triangle, it displays a square.
  2. 12.5 points. Now modify your program to accept keyboard input. Your program should allow the user to change the color of the square, by pressing the r (red), g (green), or b (blue) keys.
  3. 12.5 points. Now modify your program so that it accepts input from the mouse. If the user right clicks the mouse, with the mouse over the square, turn the square into a diamond.
  4. 50 points. Now we will modify the program to allow more continuous user input so that the user can drag the square around. Modify your program so that if the user left clicks the mouse while the mouse is on top of the square, and then holds the mouse button down and drags the mouse, then the square will be dragged by the mouse. a. As the square is being dragged, the mouse pointer should remain over the same point on the square as it was when the mouse was initially clicked. As the mouse is moving, the square should move continuously with the mouse. b. If the user clicks the left mouse button with the mouse outside of the square and then drags the mouse, the square should not move, even if the mouse is dragged over the square. You do not have to worry about dragging a diamond that might be produced by a right mouse click.