Loyola College in Maryland

CS 489 - Computers and Games
Spring 2009


Loyola College > Department of Computer Science > Dr. James Glenn > CS 489 > Homework > Homework #1

Due: Monday, February 9th at the beginning of class

Problem 1: Translate the following positions from the model's coordinate system to the view's coordinate system. Assume that the model's coordinate system runs from (0, 0) to (20000,10000). Assume that the view's coordinate system runs from (0, 0) to (1000, 500). Translate the points twice: once assuming that the entire model coordinate system will be visible in the view, and once assuming that the view covers only the window whose opposite corners are (4000, 2000) and (6000, 3000) in the model's coordinate system (simply write "not visible" when appropriate). Round points in the view coordinate system to integers.

Problem 2: Pick a game object from a 80s-era video game and describe the corresponding finite state machine. Pick an object that has at least four states and responds to at least three different events (joystick directional input may be considered different for each direction if the corresponding actions are significantly different, for example jumping vs. walking for up and left/right). Indicate what transitions occur for the events, and indicate which states are time-sensitive.

Problem 3: Draw the quadtree that results from inserting the following points selected from the rectangle whose opposite corners are (0, 0) and (80, 80).

Problem 4: Show which nodes in the quadtree from Problem 3 are examined when performing a traversal to find all points less than 12 units from (60, 60).

Problem 5: Illustrate the operation of the nearest neighbors algorithm on the quadtree from Problem 3 when finding the 3 nearest points to (50, 20).

Problem 6:


Valid HTML 4.01 Transitional