# How do I move a 3D particle using the Mercury particle engine?

I'm currently creating a 3D game with XNA, and I am in need of some particles.That's why I searched for a particle engine. I found Mercury, watched the tutorials and integrated it in the game.

But now I have a problem, I trying to have particle in 3D but I don't how to do this with Mercury. How can I do this (is it even possible)?

Mercury is a 2D particle engine, so you can't directly position/manipulate/simulate particles in 3D using it.

While you could perhaps abuse it into looking 3D with a combination of a custom modifier on an emitter and some clever overloading of particle properties (or outboard storage of extra particle data), you're better off finding another solution.

Mercury is open-source and released under a reasonably permissive license (MS-PL) so you could fork it and adopt its techniques to 3D rendering. You could also look for alternatives or hand-roll a solution. There are several examples you could use as a starting point:

...and several others available via Google. There's also this API which may be useful.

EDIT:

As a follow-up to Jaakko's comment I went and dug around their repository a little more. They do appear to have a "4.0" branch which looks like it will (or perhaps already does) support 3D. If this is the case and you can use the API from that branch (I'm not clear on its release status), you probably just need to create a custom particle modifier and attach it to your emitters. You can instantiate this modifier with whatever additional data you need to compute the 3D positions, and in the modifier's Process method, apply whatever logic is appropriate and update each particle's 3D position directly.

• Im pretty sure that source/trunk versions of Mercury have been 3D for like 6 months. Though, havent used. – user9790 Oct 14 '11 at 0:19
• I was basing my comments off examination of the source in the mainline, mostly (Particle.cs has Vector2 for the position for example). I went and poked around more after your comment, and it does look like there is a branch that will support 3D. – user1430 Oct 14 '11 at 0:26

If you can't with Mercury, one option would be to check out the sample in the education section of the app-hub.

http://create.msdn.com/en-US/education/catalog/sample/particle_3d

• I try this one , but I need a more powerfull engine. thanks – Inu Oct 13 '11 at 13:56