I have bunches of lines that I want to animate for sparks effect.
In my particle engine, I have gravity which I set to 0.0f, 10.0f, 0.0f. (sparks will move up)
The sparks will be generated in random initial position.
In the particles Update() code:
currentParticle.position += gravity / elapsedTime;
I use the following to draw each spark line:
void RenderSingleLine(D3DXVECTOR3& lineFrom, D3DXVECTOR3& lineTo)
{
// Code to draw spark line according to lineFrom and lineTo here...
}
How do I set lineFrom and lineTo according to the current spark position and gravity?
I want the lines to always point at the direction it's moving toward.