The idea from this came from someone asking how to do their homework assignment.
As I get bored often, I thought I'd have a go at it.
Here's the result:
I may post source later. I don't want it to be plagiarized
Printable View
The idea from this came from someone asking how to do their homework assignment.
As I get bored often, I thought I'd have a go at it.
Here's the result:
I may post source later. I don't want it to be plagiarized
Thats pretty cool...
Any chance of varying the type of fireworks?
Probably.
How position and velocities are initiated:
Pcles(p).Part(i).x = rx
Pcles(p).Part(i).y = ry
Pcles(p).Part(i).Vx = Cos(-3.1416 + (6.2832 * (i / PCnt))) * 8 * Rnd
Pcles(p).Part(i).Vy = Sin(-3.1416 + (6.2832 * (i / PCnt))) * 8 * Rnd
You could make them lots of semetrical shapes fairly easily.
The physics include friction, gravity, and wind.
Also, the particles reduce from 4 pixels to 1 depending on their life, which is derived from their RGB.
Here's a new version with 11 different styles with 8 different color schemes. That's 88 unique displays.
;)
Now 13 styles. 104 unique fireworks! :D
Also, FPS Accuracy problem fixed.
Command1 redesigned, fps display optional.
Offically named DEFireWorks, very original of me... :confused:.
I was thinking of releasing source, but as only one person has replied.... It doesn't seem anyone wants it.
:p
this looks good! can you post the code? :)
It'd be cool to one day have this generate thousands of unique fireworks. :cool:
Hopefully this is a step in the right direction.
Here's the source:
Questions or comments?
Now with alphablending!
It looks really nice now!
Why dont you use SetDibits? Its much faster!
Then you dont have to use AlphaBlend api...just add the color directly to the array and it will run much faster!
Alphablend receives hardware support for my system. I have a Radeon 9000 Pro 128 MB DDR.Quote:
Originally posted by cyborg
It looks really nice now!
Why dont you use SetDibits? Its much faster!
Then you dont have to use AlphaBlend api...just add the color directly to the array and it will run much faster!
It's just as fast as bitblt for me. I get ~20 FPS. Looks decent when adjusted to run at 32 fps.
But you can certainly do it. ;)
well...if you use SetDibits you dont have to bitblt at all.
True, but coding wise, as this is not a serious project, and I already know how to use DIB's. My time could be better spent coding a more serious project... like the one I'm being paid to program. And performance is acceptable for me. So as they say... it's not my problem.Quote:
Originally posted by cyborg
well...if you use SetDibits you dont have to bitblt at all.
:o
I tested just the calculations.
The drawing takes up less resources than calculating the pixels.
Without the drawing given 12 fireworks with 100 points it peaks at about 50 FPS. With the drawing 40 FPS.