Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Particle Engine for 2D
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

EACam
Warrior

154 Posts

Posted - Apr 28 2004 :  4:38:10 PM  Show Profile  Reply with Quote
Well...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.

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).

Ok...here'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...

Edited by - EACam on Apr 28 2004 4:39:40 PM

Spodi
Warrior

USA
142 Posts

Posted - Apr 28 2004 :  5:23:18 PM  Show Profile  Visit Spodi's Homepage  Send Spodi an AOL message  Click to see Spodi's MSN Messenger address  Send Spodi a Yahoo! Message  Reply with Quote
check out Almar's or RobyDX's particle engines.


vbGORE
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - Apr 29 2004 :  1:01:30 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
You'll need to create a world, projection, and view matrix to positition your particles correctly.
Go to Top of Page

cjb0087
Knave

Australia
76 Posts

Posted - Apr 30 2004 :  06:11:53 AM  Show Profile  Visit cjb0087's Homepage  Reply with Quote
try making your own particle engine, you would be surprised how easily an alright one can be made

www.bugsplat.tk
Go to Top of Page

EACam
Warrior

154 Posts

Posted - Apr 30 2004 :  12:48:40 PM  Show Profile  Reply with Quote
Almar's tutorial is precisly what I need...and for 2D! Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.