Particle Engine for 2D
EACamWell...once again Mr. "I have problems with 2D" is "having problems with 2D"...namely, converting Jack Hoxley's wonderful but STUPID 3D! tutorials into 2D. [}:)][}:)][}:)][xx(] Since I'm using 2D I DO NOT HAVE: A projection matrix A view matrix Or any other matrix! That's just about the only difference (besides the fact that my geometry is all the same). So, I've solved my lighting problem by simply doing it without Direct3D. But here's an effect that is slightly harder to "just do it myself." Not really, actually. But I'm trying to use point sprites, and not a whole slew of polygons (if I have to, I will, but I want to try my best with this first).'s my problem. I am initializing 1000 particles (I made it that big just to make sure its working) and all I get is a black square precisely where the start of the effect is supposed to occur. I haven't programmed any physics yet, but that shouldn't matter, those particles should still render. I've discovered that no matter how many particles I have, all i get it the same sized box in the middle of th screen. At some point (after I've faded a few things) the box dissappears and is as gone as a goose in the desert. I'll go into a TON more detail even giving my code if anyone needs it. But I just want to make sure there's nothing basic I could be forgetting. I've initialized an array of particles (two arrays actually, one vertex array for rendering (with it's appropriate FVF) and another for keeping the info I need for the physics). In the init, I put them all in generally random places (for testing purposes) and given them all a color. Then, when rendering, I set the vertex shader, I turn off rendering to the Z buffer, I set a texture (It, though, does not have any transparency, I loaded it with the D3DX.LoadTextureFromFile, not the LoadTextureFromFileEx), I turn on transparency, and then I render using the DrawPrimitiveUP giving the POINTLIST tag, the first element of the array, and then the size of each element (in bytes)... Am I missing something crucial? Thanks for this one too...
Spodicheck out Almar's or RobyDX's particle engines.
Eric ColemanYou'll need to create a world, projection, and view matrix to positition your particles correctly.
cjb0087try making your own particle engine, you would be surprised how easily an alright one can be made
EACamAlmar's tutorial is precisly what I need...and for 2D! Thanks!