CS408 / CS 808 Assignment 1

Particle System

Due: January 21, 2017

For this assignment, you will implement an interactive animation system that controls a particle system, where a particle system is a collection of many minute particles that together represent a “fuzzy” object (fire, snowstorm, fog, clouds, water). You may use any programming language and graphics package to implement the animation system. If you are using C++ with the OpenGL graphics package, it is recommended that you complete Labs 1–3 before attempting this assignment.

The animation system should display a graphical window with a black background and a number of moving particles on it. The user can adjust the properties of the particles using keyboard input. The input should only affect particles as they are being created. Thus, once a particle has been created, it should not be affected by input.

By default, the animation system should emit particles with the following characteristics:

·  1 particle emitted per frame (i.e. one each time the update function is called) or 60 per second

·  Dark grey in colour, with RGB = (0.25, 0.25, 0.25)

·  Transparency of 1.0 (fully opaque). Use additive transparency.

·  Side length of 100 pixels

·  Emitted from the middle of the screen

·  Moving at a speed of 5 pixels per frame or 300 pixels per second

·  Moving generally toward the right (the base angle is equivalent to moving exactly to the right side of the screen)

o  Example: the base angle is 0 degrees in a right-handed coordinate system with the positive X axis going to the right, the positive Y axis going up, and positive Z axis coming directly out of the screen. On January 11, 2015 8:20 pm, a change was made to the main3.cpp file for Lab3 to produce this type of coordinate system.

·  The direction of movement is randomly selected anywhere up to 30 degrees on either side of the base angle.

·  Lifetime of 60 frames or 1 second

·  Square in shape

The user should be able to issue the following commands:

Property / Increase / Decrease / Minimum / Maximum
Red colour component / ‘R’ / ‘r’ / 0.0 / 1.0
Green colour component / ‘G’ / g’ / 0.0 / 1.0
Blue colour component / ‘B’ / ‘b’ / 0.0 / 1.0
Transparency / ‘T’ / ‘t’ / 0.0 / 1.0
Size / ‘+’ / ‘-’ / 1 / 200
Emitter X position / ‘d’ / ‘a’ / - half window width / half window width
Emitter Y position / ‘w’ / ‘s’ / - half window height / half window height
Particle speed / up arrow / down arrow / 0 pixels / frame / 10 pixels / frame
Particle movement direction (in degrees)
An increase corresponds to a counterclockwise rotation from viewpoint of user. / left arrow / right arrow / unlimited / unlimited
Shape (see below) / ‘H’ / ‘h’ / 0.5 / 3.0

The exact amount to increase or decrease a feature in response to a command should be determined by experimentation. Suggestion start with 0.01 for values related to distances and 1.0 for values related to angles and then find a comfortable speed of change.

The shape of the particles is defined using 8 vertexes as shown in the diagram below.

The 4 corner points are fixed, while the 4 side points move nearer or farther from the shape center based on the shape parameter. The following 5 diagrams show the shapes for 5 possible parameter values.

Suggestion: When drawing the above polygons, use a triangle fan (GL_TRIANGLE_FAN), with the first vertex at the center of the polygon, all edge vertices listed in counterclockwise order, and then the first edge vertex again (don’t go back to the center).

Creative Feature(s): After completing the above requirements, add one or more creative features. The complexity of the creative features should be at least 1/6 of the total of program described above. A program with no creative features will receive a maximum mark of 85%.

If the creative features interfere with above program requirements in any way, you should submit two versions of your software for evaluation, with and without creative features (e.g., A1-yourlastname-yourfirstinitial-creative.sln and

A1-yourlastname-yourfirstinitial.sln).

In the source code, put

// CREATIVE FEATURE

or similar comment before the relevant parts of the code.

Creative Feature Documentation (a separate file called Creative.pdf, Creative.txt, or Creative.doc): explain what the creative feature is, any relevant user commands, location(s) where it is present in the code (file name, function name). Features for which the code is given in the labs cannot be used as creative features.

3