• Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

We're also offering banner ads on our site from just \$5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

### #ActualAllEightUp

Posted 16 May 2013 - 08:42 PM

Been a while since I've done D3DX stuff, sorry.  Let me see if I can explain it well enough so you can convert it:

emission.x would be the "X" value of the coordinate system around your emission point.  It is a Vector3.

You scale, or set the length/magnitude, of the x vector to the random value between -1 and +1.

So, the result should be a vector3 again.

Do the same to the y coordinate axis and add that to the result of the x scaling.

You end up with a randomized vector3 in the x/y plane.

The final item is normalize the emission direction (+z) plus the offset vector which is scaled by the randomness value.  Finally you scale the result by the desired velocity.

NOTE: Perhaps this will help, nothing other than scale, add or normalize are in use within this.

### #1AllEightUp

Posted 16 May 2013 - 08:27 PM

Been a while since I've done D3DX stuff, sorry.  Let me see if I can explain it well enough so you can convert it:

emission.x would be the "X" value of the coordinate system around your emission point.  It is a Vector3.

You scale, or set the length/magnitude, of the x vector to the random value between -1 and +1.

So, the result should be a vector3 again.

Do the same to the y coordinate axis and add that to the result of the x scaling.

You end up with a randomized vector3 in the x/y plane.

The final item is normalize the emission direction (+z) plus the offset vector which is scaled by the randomness value.  Finally you scale the result by the desired velocity.

PARTNERS