Lab 07: October 30, 2018

Overview

Today's lab is to render and animate particles.

Tasks

No code is provided this lab.

Your task is to define arrays of points and vectors to represent the parameters of the particles. Lets start with 32 elements. Create an array of vector3 objects to hold the particle's positions.
Create an array of vector3 objects to hold the particle's velocities.

Using the position and velocity elements we can update each particle's position each frame with the simple motion equation:
P(t) = P(0) + V(0)*t

Using the updated position, we can render particles updating over time. If we use the new position (P(t)) as the center of the particle, we can use it to render a quad for each element.
Try setting P(0) to the same point in space and V(0) to a (different) random vector for each particle when you hit a key on the keyboard.


Note: float r = (float)(rand() % 1000) / 1000.0f; // Will produce a random value between 0.0f and 1.0f
Note: P(0) and V(0) are initial conditions and are called "emission properties".
Note: The only parameter that is changing in this equation is t, causing the resutant P(t) to change over time. You must track t relative to the emission time. (i.e. when you press a button to start the animation)