Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Gandalf's Particles
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
[Gandalf]




PostPosted: Fri Feb 10, 2006 12:28 am   Post subject: Gandalf's Particles

Here are a few examples of a particle engine I made a while ago to experiment with various things (colours, physics - which I didn't get around to adding too much of, etc.). Think it's about time to post another one of my past creations.

The first example, Particles -> Spray, follows the mouse and sprays the particles from the location of the cursor. The file that comes with it, data.txt allows you to change 3 things: the size of the particles (either "big" or "small", the general colour of the particles ("red", "green" or "blue"), and the initial amount of particles. Something to note, Turing draws small particles quite a bit faster than larger ones, so keep that in mind when choosing the amount. While running the program, you can also change the current number of particles in increments of 10 using the "+" and "-" buttons.

The second example, Particles -> Snow Simulation uses the same engine to create a simple demo of snow falling at various velocities and sizes. I used it to experiment on per-pixel collision, which proved too slow for use. You can reset the snow by clicking the mouse. The file that comes with this example, snowdata.txt, allows you to specify the amount of particles in the simulation.

Now, I'll have to admit... If you're only going to download one of these, the more impressive one is probably the first. The second simulation is just a different setup with some features disabled, but it still looks pretty neat.

Note: As with anything, I am creating an improved particle engine currently, which is why I dug this up.



Gandalf Particles Spray.zip
 Description:
Spray Particles Demo

Download
 Filename:  Gandalf Particles Spray.zip
 Filesize:  272.13 KB
 Downloaded:  203 Time(s)


Gandalf Snow Simulation.zip
 Description:
Snow Demo

Download
 Filename:  Gandalf Snow Simulation.zip
 Filesize:  271.41 KB
 Downloaded:  161 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Fri Feb 10, 2006 5:50 pm   Post subject: (No subject)

wow that looks amazing i sure wish i had those kind of skills
Delos




PostPosted: Fri Feb 10, 2006 6:10 pm   Post subject: (No subject)

For your snow:
- randomize the y-value of the initial particles to some distance off the screen i.e., don't start them all from maxy.
- if you don't mind having a screen full of snow initially, then also randomize their positions throughout the screen.

This will save you having that block of snow falling initially.

+bits
Clayton




PostPosted: Fri Feb 10, 2006 6:13 pm   Post subject: (No subject)

you could also have it so that the snow gradually thickens and dissipates over time this could make it look very cool too
[Gandalf]




PostPosted: Sat Feb 11, 2006 1:31 pm   Post subject: (No subject)

Delos, the initial y value is already slightly randomized at Rand.Int (maxy, maxy + 200), but it doesn't make enough of a difference. 1000 seems like a better value so the snow doesn't spawn in 'groups'. I tried your suggestion of randomizing the starting positions across the screen, and it works well but takes away from the snow-like effect.

SuperFreak82, I already tried something like that, but it didn't really look like snow anymore. That kind of thing would be better to have with the snow building up on the ground (ie. using pixel collision), and the snow disappearing after some time, but it was way too slow.

Thanks for the suggestions and bits.
iker




PostPosted: Sat Feb 11, 2006 4:27 pm   Post subject: (No subject)

That snow particle this looks extremely firmiliar, just like the one where the snow followed your mouse... unless you made that one Gandalf, I can't remember and I'm to lazy to Search for it
[Gandalf]




PostPosted: Sat Feb 11, 2006 5:05 pm   Post subject: (No subject)

Yes indeed, I recall there was something quite similar posted previously, but I made my own demo based off the particle engine. Both examples posted run off the same 'framework'. Snow is just one thing that came to mind that would be easy to emulate. If you're saying I plagiarized it, think of it this way: how would you create a demo of snow using particles? It would probably look quite similar. If you still doubt me, I think I can provide sufficient proof that I didn't copy it, but it doesn't seem like such a big deal to me.
Dan




PostPosted: Sun Feb 12, 2006 4:06 pm   Post subject: (No subject)

Nice work. I like the Spray one, it gets cool when u have the partical # at 10000. I have seen work like this but it deftaly was not exctaly this.

Any how good work and i hope you reales the sorce for otheres to learn from once u get it perfifected.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
iker




PostPosted: Sun Feb 12, 2006 5:17 pm   Post subject: (No subject)

I believe you, and its no big deal at all. Just to let you know, their both very well done. Maby mix a bunch of different colored "particles" instead of all one color specified.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: