Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fireworks....

Started by BeyondDeath Nov 18, 2000 at 6:48 PM 9 replies 1.1k views
Original Post
BeyondDeath
BeyondDeath
Ok, ive got a system now that has no gravity (easilly added), and each particle gets shot out of the orgin at its own random speed, my problem is i want this to form a circle, not some warped square type shape... how is this possible, THANKS allot all
Amy
Amy
okay, you have to rotate each particle around the center point (i.e. where te bang happened).

Edited by - Amy on November 18, 2000 8:03:22 PM
slartibartfast00
slartibartfast00
Are you shure that''s the best way to do it?

I just use the "Warped Square Shape" most of the time, but there is probably a way using some trig functions or somthing to fix it. I don''t think rotation would work.



SLARTIBARTFAST00
PLEASE SELECT WITTY .SIG:
SLARTIBARTFAST00
BeyondDeath
BeyondDeath
I was thinking something a little bit more spicific, how do you mean to rotate it around where the bang happened, i think i know where you are going, but i dont know how you would do this...
zedzeek
zedzeek
deg = 0-359
vel.x = sin(deg)
vel.y = cos(deg)

[edit] u prolly want to convert the deg to radians first

http://members.xoom.com/myBollux
BeyondDeath
BeyondDeath
Ok, that works, Its close, how could i make it have some particles moving slower than others etc.. so it has a fill effect...

Thanks mr.l33t
zedzeek
zedzeek
well u could do someit like this
vel.x = sin(deg)/10
vel.y = cos(deg)/10
10x slower

vel.x = sin(deg)*5
vel.y = cos(deg)*5
5x quicker



http://members.xoom.com/myBollux
BeyondDeath
BeyondDeath
Yay, thats awesome, just have to note, if its less that 1.0 then its reverse ehhe
Julien
Julien
If you''re looking for nice particles effects you should try to add forces like magnetic fields or attractors/repulsors.
A magnetic field gives your particles a spiral path, an attractor gives them an elliptic or round path.
And when you mix those forces It can make amazing effects.
If you want to know more about how to code those forces tell me ...
You can look at my particles engine on

My Web Page
BeyondDeath
BeyondDeath
Wow, I''d be interested, but I have a feeling it will be real heavy on confusing math.Im in grade 10 and I havent started math yet so Im not into matrices and the good stuff yet... (soon I''d hope)
Julien
Julien
Well, I don't know the american study levels, so "grade 10" doesn't tell me anything ... anyway, I think it's not so difficult as you can imagine. I don't use any kind of matrix since I use an explicit integration.

All you have to know is how to find the force vector of any particle, given a weight, a polarity a position and a thrust vector. Then If you know the expression of the force depending on those parameters you're ready.

I give you the expressions :
magnetic field :
F = q/m * V^B
F is the resulting force
q is magnetic polarity
m is the particle weight
v is the particle velocity vector
B is magnetic field vector
and ^ is the croos product

Attractor/Repuslors :
F = q1*q2*R/d
F is the resulting force
q1 and q2 are the particle and attractor polarity
R is the radial vector from the attractor to the particle
and d is the distance between the particle and the attractor

Well I think you know what to do with that, if not I'll tell you in an other reply, because this one is already quite long


My Web Page

Edited by - julien on November 20, 2000 6:56:52 PM

Edited by - Julien on November 20, 2000 6:58:27 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.