Advertisement

Particle Effects

Started by September 24, 2002 03:43 PM
3 comments, last by StephenH 21 years, 11 months ago
Hi, I''m not sure if this is the place to post this question but it seems like a pretty simple thing to do. I''m trying to create a program similar to Longbow Digital Arts'' Particle Fire. Specifically im trying to create the swirls and explosions. My particle type consists of x,y,dx,dy, and count (dx and dy being the velocity). I''m using an array of 100 particles. Any help would be appreciated.
Am I missing something? What exactly is your question?

pan narrans
Study + Hard Work + Loud Profanity = Good Code
Minister of Propaganda : leighstringer.com : Nobody likes the man who brings bad news - Sophocles (496 BC - 406 BC), Antigone
Advertisement
I don''t know the state of your paticle system. I''m writing one myself. so here are some (very basic) pointers:
- you can do gravity by adding a small number to the dy.
- you can do an explosion by setting all points to one pixel then giving them a random dx and dy
- the swirling effect depends on the atraction algorithm you use, mine works different so i don''t get the swirling (got to work on that)

ok gotto go happy coding
Hi,
Sorry your right I wasn''t very clear. I''m trying to figure out how to make a particle move in a circular pattern. And thanks for the advice ravvin.
Well, this *might* help. I am working on a helix-like particle effect for a weapon in my game. The particle's update code looks like this:


      	// Update position based on velocity	D3DXVECTOR3 v;	D3DXVec3Scale( &v, &m_vVel, FRAMERATE_S );	// FRAMERATE_S is the change in time since the last frame -- I'm running at a constant 60fps so...	m_vPos += v;	// Build the helix	float t = (RAILGUN_LIFE - m_fAge) * 10.0f;	// Time	float c = HELIX_VERT_DIST + (float)m_nIndex * 1.5f;	// Constant giving the vertical separation of the helix's loops	v.x = m_fRadius * (float)cos( t * PI );	v.y = m_fRadius * (float)sin( t * PI );	v.z = c * t;	m_vVel = v;	// Update the velocity      


Now, I think if you want circular motion, you can just set v.z = 0.0f; or something like that. You will also have to rotate the effect to point in the direction you want it to (since it's created along the z axis). Maybe that helped?

I should also mention that this is a work in progress so it may not be perfect yet.

[edited by - beoch on September 25, 2002 8:35:52 PM]

[edited by - beoch on September 25, 2002 8:36:32 PM]

This topic is closed to new replies.

Advertisement