Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMedo3337

Posted 16 May 2013 - 05:35 PM

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.


#4Medo3337

Posted 16 May 2013 - 05:32 PM

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?


#3Medo3337

Posted 16 May 2013 - 05:31 PM

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)

 

How do I set lineFrom and lineTo according to the current spark position and gravity?


#2Medo3337

Posted 16 May 2013 - 05:30 PM

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)

 

How do I set lineFrom and lineTo according to the current spark position and gravity?

 


#1Medo3337

Posted 16 May 2013 - 05:21 PM

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.

 

I use the following for drawing each spark line:

 

void RenderSingleLine(D3DXVECTOR3& lineFrom, D3DXVECTOR3& lineTo)

 

 

How do I set lineFrom and lineTo according to the current spark position and gravity?

 


PARTNERS