Results 1 to 15 of 15

Thread: fireworks

  1. #1

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    fireworks

    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
    Attached Files Attached Files

  2. #2
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Thats pretty cool...


    Any chance of varying the type of fireworks?
    You just proved that sig advertisements work.

  3. #3

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    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.

  4. #4

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Here's a new version with 11 different styles with 8 different color schemes. That's 88 unique displays.
    Attached Files Attached Files

  5. #5

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    latest version

    Now 13 styles. 104 unique fireworks!

    Also, FPS Accuracy problem fixed.

    Command1 redesigned, fps display optional.

    Offically named DEFireWorks, very original of me... .
    Attached Files Attached Files

  6. #6

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    I was thinking of releasing source, but as only one person has replied.... It doesn't seem anyone wants it.


  7. #7
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    this looks good! can you post the code?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  8. #8

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    It'd be cool to one day have this generate thousands of unique fireworks.

    Hopefully this is a step in the right direction.

    Here's the source:
    Attached Files Attached Files

  9. #9

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Questions or comments?

  10. #10

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Now with alphablending!
    Attached Files Attached Files

  11. #11
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  12. #12

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    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!
    Alphablend receives hardware support for my system. I have a Radeon 9000 Pro 128 MB DDR.

    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.

  13. #13
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    well...if you use SetDibits you dont have to bitblt at all.
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  14. #14

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by cyborg
    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.


  15. #15

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width