Results 1 to 2 of 2

Thread: Particle Engine [release 1.0]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2002
    Location
    Phoenix
    Posts
    30

    Particle Engine [release 1.0]

    Hi all. The particle engine I've been working on for a while now, is finaly finished. After testing it to make sure its stable, I've decided it's ready for public release. v1 is still considerable Beta, but I'm confident in its ability to satisfy all your particle needs.

    The Engine works on a filter theory. You keep arrays of particles, and run each array through the desired particle filter which then produce the desired effect. I'll attach the engine (5 modules, one form) in a zip file to this post, and follow up with a (LENGTHY) post with the source and comments. Consider it your online-documentation :P.

    If youd like to see a demo or two of the engine in effect, try these:
    http://amithran.hybd.net/downloads/matrix2.zip
    http://amithran.hybd.net/devjournal/pengine.zip


    The engine.zip file includes 6 files.
    form1.frm (example form with 4 effects)
    PE_DrawParticles (draw subs)
    PE_MiscFunctions (miscelanious subs that belong no where else)
    PE_ParticleFilters (House the 4 particle effect filters )
    PE_PublicDeclares (Pretty self explaining:P )
    pe_udtDefinitions (My own custom var types)
    Attached Files Attached Files
    Last edited by Amithran; Sep 19th, 2002 at 03:45 AM.
    I'm in college now.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2002
    Location
    Phoenix
    Posts
    30
    First of all, let me thank you for showing interest in my particle engine.
    The engine is pretty self documented and the form thats with it serves as a slightly
    advanced example of how to use it. Tutorials, and documentation will be made available at a later time.


    Here is the out right basic code you need for one particle effect being drawn to the form:

    =====================================================
    VB Code:
    1. Option Explicit
    2.  
    3. Dim fireParticles() As udtParticle
    4. Public NumParticles As Integer
    5. Dim mouseX, mouseY As Integer
    6. Dim screenWIDTH, screenHEIGHT As Integer
    7. Dim complexity As Integer
    8.  
    9.  
    10.  
    11. Private Sub Form_Load()
    12.     'Set form attributes
    13.     Form1.WindowState = 0
    14.     Form1.Width = 400 * Screen.TwipsPerPixelX
    15.     Form1.Height = 320 * Screen.TwipsPerPixelY
    16.    
    17.     Timer1.Interval = 15
    18.  
    19.     mouseX = (Me.Width / Screen.TwipsPerPixelX) / 2
    20.     mouseY = (Me.Height / Screen.TwipsPerPixelY) / 2
    21.     screenWIDTH = Me.Width / Screen.TwipsPerPixelX
    22.     screenHEIGHT = Me.Height / Screen.TwipsPerPixelY
    23.  
    24.  
    25.     'particle count per particle effect, 550 is a bit high
    26.     'I suggest 250 to start with.
    27.     NumParticles = 550
    28.     complexity = 1
    29.     Me.AutoRedraw = True
    30.  
    31.  
    32.     'Controllers are where the "center" of every particle
    33.     'effect is created. If you want to move a particle effect
    34.     'across the screen you simplye move the controller.x and .y
    35.     'across the screen and the filters will do all the hard work
    36.     'for you.
    37.     ReDim Controllers(1) As tOrigin
    38.     Controllers(0).m_oX = mouseX
    39.     Controllers(0).m_oY = mouseY
    40.  
    41.  
    42.     ReDim fireParticles(NumParticles)
    43.     Call setParticles(fireParticles, 0, Controllers)
    44.  
    45.    
    46.  
    47. End Sub
    48.  
    49. Private Sub Timer1_Time()
    50.             Me.Cls
    51.  
    52.             Call fireFilter(fireParticles, 0, Controllers)
    53.             Call DrawParticles(fireParticles, complexity, Form1.hdc)
    54. End Sub
    =====================================================



    A few notes about the engine:
    1.) This is its' first release, and my first public project. Very likely things arn't being done very efficiently this version, but in future releases I hope to fix those things.
    2.) Only 4 filters are available with this version, but it is very easy to create your own, give it a try.
    3.) Feel free to make modifications to the code, if you use this engine (modified or not) please give me credit, All I ask is "Particle Engine by Jeremy Giberson: http://amithran.hybd.net." Thanks in advance.

    4.) Contacting me: PLEASE PLEASE, if you have a problem try to fix it yourself, more then likely its a syntax error. If you have made additions to the code that are significant (fps performance, usability, particle filters) please do drop me a line and let me know.
    My email is: [email protected]

    5.) Last but not least, I am not responsible for any damage done to your computer due to the miss-use of this code. IN all likely hood, nothing in this engine is harmful, or will cash any problems, but as a famous lawyer once said: Cover your ass-sets.. The code is release as is.

    Once again, thanks for trying my engine out.




    [EDIT] I decided NOT to include the source here, its just too much.
    Last edited by Amithran; Sep 19th, 2002 at 03:49 AM.
    I'm in college now.

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