There is something I'm unsure about.
All I have is "D3DXVECTOR3 gravity", how do I get dirVec and upVec from gravity?
Gravity is a particle effector, it has nothing to do with the dirVec and upVec which are part of the emitter. I don't know if there is a language barrier here or if you just really don't understand the very basic bits of vector math, either way I suggest you should be able to figure this out on your own. I'll simply describe how I would write things and then leave it to you to figure out the rest:
Vector3f Direction // dirVec
Vector3f Up // upVec
float EmissionAngle // Radians, I don't do degree's...
Initialize the emitter (source and target are points in space, source is where the particles start, target is the direction they move towards initially)
emitter.Position = source.
emitter.EmissionVelocity = 10.0f;
emitter.Direction = Normalize( target - source );
// Check for a valid reference axis, can't be the same as +-direction vector.
if( Abs( Dot( emitter.Direction, Vector3f( 0, 1, 0 ) ) ) < 0.001f )
emitter.Up = Normalize( Cross( emitter.Direction, Cross( emitter.Direction, Vector3f( 1, 0, 0 ) ) )
emitter.Up = Normalize( Cross( emitter.Direction, Cross( emitter.Direction, Vector3f( 0, 1, 0 ) ) )
Initialize a particle:
particle.Position = Emitter.Position;
// Replace dirVec and upVec in the function with references to the emitter data.
particle.Velocity = GetRandomVector( emitter ) * emitter.EmissionVelocity;
Update a particle:
particle.Position += particle.Velocity * deltat;
particle.Velocity += effectors.Gravity;