I'm confused.

emission is a Vector3, emission.z is a float.

If I do the following, the program will not compile:

D3DXVec3Normalize(emission.z+offset*emission.randomness);

However, I tried doing it using the way I have in my engine, it could be the same way as your way:

void generateNewParticle() { // Code to generate a new particle here... D3DXVECTOR3 randVec = GetRandomVec(); particle.velocity += randVec * 4.0f; }

D3DXVECTOR3 GetRandomVec() { D3DXVECTOR3 vVector; vVector.z = getRandMinMax( -1.0f, 1.0f ); float radius = (float)sqrt(1 - vVector.z * vVector.z); float t = getRandMinMax( -D3DX_PI, D3DX_PI ); vVector.x = (float)cosf(t) * radius; vVector.y = (float)sinf(t) * radius; return vVector; }

Althought it works, I have slight problems at the particles generation point, the particles are not looking at the moving direction when generated:

[attachment=15766:problem.png]