|
-
Aug 18th, 2002, 11:29 AM
#1
Thread Starter
Fanatic Member
Jotaf - Particle Systems Help
I read ur paper on particle systems, and i downloaded all the forms, and i tried to understand as much as i could. But some of it i just cant make sense of. I was wondering how u got it to draw so fast? And i was always wondering if u could try to explain how it works a little. I wanted to make some of my own custom systems, but i just cant make sense of it.
-
Aug 18th, 2002, 12:35 PM
#2
Good Ol' Platypus
He uses SetPixel which is pretty fast - I can get loads of effects running on a GF2mx/cel 533, which is great. But it's not the fastest way... Basically his particle systems loop through the particles, do math on them to update the position, and then draw them. They follow that loop until they "die" (different for every particle system, for example if they're offscreen), and then they're created again. It's quite simple really.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 18th, 2002, 02:15 PM
#3
Thread Starter
Fanatic Member
Ive been trying to understand the rain system for a game im making. But i want the rain to run in front of all the pictureboxes. If i copy and paste the code it will go behind all my pictureboxes except picfront.
-
Aug 18th, 2002, 05:09 PM
#4
Good Ol' Platypus
That's because the picturebox itself is behind all the pictureboxes... Look up a technology called BitBlt. BitBlt all your pictureboxes to one FRONT picturebox, and then use the particles over it. In this way, you can have animated pictures, transparency (ex. a colour in the bitmap is seethrough), etc.
It's a real evolutionary step in games development.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 18th, 2002, 06:05 PM
#5
Thread Starter
Fanatic Member
so should i blit the background, then the pictureboxes, and then the rain, that way it will have background in back pics in middle and rain up front? How could i blit the rain with transparency.
-
Aug 18th, 2002, 06:27 PM
#6
Good Ol' Platypus
If you're using his code, it already does it.
And yes, that's the order you do it in.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 18th, 2002, 06:53 PM
#7
Frenzied Member
*phew* Sorry I'm so late 
Ok, huh it's like Sas says it's really simple... I can't explain the effect better than him. You have a lot of particles, each one is a rain drop. Every frame, the code just loops trough each one of them, moves it a bit down or to the left or whatever, if it's reached the bottom of the screen it moves the rain drop back up, and then draws it to the screen.
The main reason why it's fast is because it doesn't have to draw a lot of pixels. If you think about it, an image that is 100 pixels by 100 pixels in size has to draw 10,000 pixels. If you have a rain effect with 100 rain drops, 3 pixels each, you only draw 300 pixels!
Anyways... I don't get it, how are your pictureboxes set up, what are you trying to do with them? Usually you only have one big picturebox where you draw everything...
-
Aug 18th, 2002, 07:18 PM
#8
Good Ol' Platypus
Yeah, I explained it to him, about Bitblt, I think he's all set now
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 18th, 2002, 07:28 PM
#9
Frenzied Member
Heh ok thanks Sas
-
Aug 18th, 2002, 11:48 PM
#10
Good Ol' Platypus
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 20th, 2002, 04:23 PM
#11
Frenzied Member
You explained all the bitblt stuff to him, so I don't have to explain anything
-
Aug 20th, 2002, 05:47 PM
#12
Good Ol' Platypus
I doubt you would've if I hadn't 
Hehe
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 20th, 2002, 06:01 PM
#13
Frenzied Member
Yeah you're right... I would probably do like most people here and give him some links
-
Aug 20th, 2002, 06:26 PM
#14
Junior Member
Pssst,
Youve got PM's jotaf.
Btw, does any one know if theres a way to "bitBlt" from an array to an hdc? If i've got an array the size of the screen with rgb info, and rather then setpixel each onto an hdc is there a way to "bitblt" it.. ??
-
Aug 20th, 2002, 08:08 PM
#15
-
Aug 20th, 2002, 09:30 PM
#16
Good Ol' Platypus
StretchDIBits is an amazing call I suggest you learn all of its ins and outs.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 20th, 2002, 09:33 PM
#17
Thread Starter
Fanatic Member
Just curios is this technology really called particle systems??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|