Shooting - How to display bullets?

Hey everyone.

I’m working on a big school project at the moment, and I’ve been using Java3D. I’m going back between flight simulator and RPG at the moment, and I have a problem that I’d like some help with: how can I make my character shoot? I’ve done everything with Picking, so I know where I’m shooting, and what I’m shooting, and stuff like that, but what’s the best way to actaully display the actual bullets? Would I use some kind of Geometry, or perhaps just draw the bullets onto a Canvas3D or something? How can I possibly do it?

Thanks,
James.

it depends on the effect you are lookign for.

If all yuou need is a muzzle flash then you cna do it with 2D animation if your gun is a 2D HUD fake, or a little
particle system if your gun is real 3D geoemtry.

if you actually want to see a projectile fly through the air your best bet is to add it as 3D geometry and animate it just as
you do anythign else in your environment.

Thanks Jeff

I think I’m going to try and go with the 3D route that you suggested. Thanks again for the reply.

James

FlyingGuns uses fast moving, slim, long and bright cylinders

Using cylinders sounds a lot easier than using a particle system. Would I just add them to the scene and then remove them after a certain distance or time or something? I’ve never really worked with adding things dynamically to a scene, so does anyone know how it works (well I’m sure most of you do, but could one of you please tell me how to do it?)?

Thanks a lot guys!

The June edition of JDJ includes an article on Java3D particle systems. It includes a section and code examples to dynamically add and remove objects from the scene. The online version is here: http://jdj.sys-con.com/read/99792.htm.

Mike

Adding and removing things from the scene graph in J3D is extremely easy.

RTJD under BranchGroup

Adding and removing graphs from a Java3D scene maybe easy but you SHOULDN’T do that in the middle of the game if possible.
Adding and removing graphs is a way of telling Java3D, you won’t see this again, or here’s something NEW, and often makes a transfer or free up of the resources for that object on the video card cache. It doesn’t guarantee a flush of the memory but it allows for it, so the next time you add back the same object it may have to transfer all the data and will impact frame rate.

When possible, use a SwitchGroup or set visiblitiy (best option).

I stand corrected. ;D

I’ve never had any problems using BranchgGoup add and remove in running scenes but I also dont do it with great frequency.