Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ekaj

Particle viewing

This topic is 6843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m trying to implement a particle system, but there''s one point I''m having trouble understanding. How do I make sure the particle polygons are facing the camera all the time? Jake

Share this post


Link to post
Share on other sites
Advertisement
There are two common accepted techniques for that:

- Rotate the particle''s polygon in such a way that it always faces the viewer. I do not have the required transforms handy over here, but I can look them up if you want. This becomes slow if you have many, many particles, since you have to calculate the required transform for each particle. Advantage of this method is that any object can occlude particles. The Z-buffer will do that for you without any user intervention required.

- (My preferred method) Project the particle onto the viewing plane. (in OpenGL, you could use gluProject for that) This yields screen coordinates which are the center of your particle. The particle''s size can be determined from the Z resulting from the projection. Now draw your particles as 2D sprites after rendering the rest of your scene. With OpenGL you should draw textured quads, with Direct3D you could do the same, or use a Blt for that. The advantage of this method is that it can easily handle thousands of particles. The disadvantage is that if you want an object to occlude your particles, you need to find out which particles are visible yourself.

Also remember that if you use alpha-mapped particles, you need to sort them back-to-front before drawing.

Hope this helps,
DaBit.

Share this post


Link to post
Share on other sites
Well in DX, couldnt you just make your particals D3DTLVERTEX so that they are never transformed in the first place. I dont exactly understand Partical Systems so please tell me if Im wrong.

Share this post


Link to post
Share on other sites
I don''t know much D3D, but couldn''t you just use a billboard?

"When people tell you they want to hear the truth, you know that their lying."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi

I am using the up and side Vectors of my camera, to draw the particles. I am using the Positional Vector of my Particle, and then add the up, and the side Vector. Then i recieve 3 Vertexe to draw a Triangle.
This way is faster than the Vertex Transformation (when you have the up and side Vectors) and it uses the Z-Buffer.

Lars W.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!