CSE328 FUNDAMENTALS OF COMPUTER GRAPHICS (SPRING SEMESTER, 2007)
CSE328 ASSIGNMENT THREE (15% of the total course grade, 300 points are used for the grading scheme of
this assignment. There are additional 60 BONUS points. Note that, ASSIGNMENT THREE consists
of two programming projects which are explained below in great details.
Due 2:10
pm on Monday,
April 23, 2007)!
Please note that, the programming project will be graded based on (1)
correctness, (2) efficiency, and (3) the quality of programming codes (i.e.,
whether they are understandable)!
(PROJECT ONE, 150 points for this project (with additional 30
BONUS points) ) The
central goal of this programming project is to allow users to
conduct the flight simulation. Write a 3-D animation program of a plane flying
over a synthetic graphics-based virtual world of our
Stony
Brook
University
campus. There is a
synthetic camera installed
in the cockpit of the plane. The plane is permitted to do: (1) a
simple, HORIZONTAL loop (i.e., circle) above the Stony Brook University campus; and (2)
a curved path defined as a user-specified cubic Bezier curve (Note that, you can
read four control points of a cubic Bezier curve from your file in order
to simplify the interface matter). Keep the university campus model simple if you
like, however, the models should at least include the following objects: (1) Frank
Melville Library, (2) Student Activities Center, (3) Health Sciences Center and
University Hospital, (4) Wang Center, and (5) several high-rise buildings such
as Physics, Chemistry, Life Sciences, and Ward Melville Social & Behavioral
buildings. You can simplify the model construction by approximating sites with
commonly-used graphics primitives such as blocks of appropriate size
for high-rise buildings and simple, planar faces of appropriate colors for
low-rise buildings or specific landmarks on campus. All the objects must
be at least flat-shaded. In addition, you should also implement either a command-line
switch or keyboard/mouse switch that supports the wire-frame display. Please note
that, there are many ways in modeling the above landmarks. NOTE THAT, in
general you are strongly encouraged to basically follow my suggestions above. However, you
are also free to use your own imagination as long as your models can represent
the object of different kinds to a satisfactory level of visual realism, i.e.,
they are similar to the underlying physical objects. The entire grades of
this project will be distributed into: (a) 40 points for the initialization of camera
view and the campus construction; (b) 20 points for wire-frame display during
the flight simulation; (c) 20 points for shaded display during the
flight simulation; (d) 30 points for horizontal loop; and (e) 40 points
for the flight along a Bezier curve. Note that, there are EXTRA 30 points for the
BONUS part! Any kinds of extra features beyond the basic requirement will be
eligible for bonus points. For example, you can (1) add more buildings into
your synthetic Stony Brook campus, (2) add local areas outside our Stony Brook
University campus into your synthetic world, (3) make your objects more
realistic with advanced shading effects, (4) make your camera follow an
arbitrary curve (i.e., not just a Bezier curve) specified by users, or (5)
advanced interface tools that facilitates the interactivity of the software,
etc.
(PROJECT TWO, 150 points for this project (with additional 30 BONUS
points) ) The
central objective of this project is to perform and experience simple physical simulations and
computer animations such as collision detection and handling and animate them using graphics techniques. Write an OpenGL program that
animates a massless (i.e., the mass can be considered
as zero in order to simplify the implementation issues) ball movement within a
three-dimensional space bounded by a block (e.g., classroom). You can
initialize a reasonable size of the block and set up your viewing volume
properly so that you always look at the center of the block from a pre-defined
position outside the block. To obtain the best visual effect, the block you see
on the screen should not be too big or too small. In order to see the ball and
its animated motion, the block space can be simply displayed using the
wire-frame method. The ball needs to be displayed as a flat-shaded object,
however. You can use any approach to define and display the ball. During the
initialization process, for example, users can interactively specify the
position (i.e., x, y, and z coordinates) as well as the velocity (i.e., v_x, v_y, and v_z
values along three directions) of the ball either via mouse or via keyboard
operations. Note that, the size of the ball must be reasonable with respect to
the block size. The velocity of the ball must not be extremely fast in order to
visualize the effect of ball's animated motion and its interaction with the
block and its walls. You should try out different kinds of combinations for
user-specified parameters first and based on your judgment on your experiments
suggest a set of best parameters for ball's size and its initial velocity as
far as the visual effect is concerned in your submitted report. After the
initialization stage is set up. Your program should animate the ball movement. In
order to achieve this goal in graphics, you should divide the continuous time
domain into many small time steps. For example, if the current position of the
ball is p, the small time interval is h, and the velocity of the ball is v,
then the new position q in the next time step can be computed easily using this
equation: q = p + v*h. The animated effect can be
obtained if you advance the time one step at a time and display the ball at its
new position sequentially. When the boundary of the ball collides with any wall
of the block, the ball's motion should be re-directed to the new and physically
correct direction. The new direction can be computed using the principle of a
simple ray reflection w.r.t . the plane. In
this project, we assume that the ball moves at the same magnitude of its
velocity, i.e., only the direction of
the ball's velocity is changed when a collision happens. Your program should be able
to figure out the right answer for the new velocity and continue to
animate the ball's movement without stopping the program execution unless a specific key is entered
by users. After all of the above capabilities are achieved, you
should further augment the functionality of your program. In particular, your program should be
able to animate two balls, three balls, four balls, and
five balls, respectively. Note that, in these five cases, your program has to properly
determine ball-ball collision as well as ball-wall collision in order to demonstrate
the physical realism. The initialization of two, three, four, or five
balls can be done in a similar manner as explained above. The
total grades will be distributed into the following components: (a) 20 points for the initialization
step; (b) 20 points for the physically correct animation of one ball
and its interaction with walls; (c) 20 points for the physically correct
animation of two balls and their interactions with walls; (d) 30 points for
the physically correct animation of three balls and their interactions with walls;
(e) 60 points for the physically correct animation of four and five
balls and their interactions with walls. EXTRA 30 points for the
BONUS part which is to generalize your program to animate multiple (n>2)
cubes or ellipsoids with collision simulation (i.e., generalization of simple
spheres to cubes or ellipsoids).