PDA

View Full Version : 3D Explosion



substance
April 20th, 2008, 07:14 AM
I was messing around with making a particle system and I managed to come up with something that worked well to make a good explosion. I wanted to go a step further and make the explosion have the illusion of being 3d (having piecies fly at you etc.) But I'm a bit stumped with created fake 3D in flash. I found a few old AS2 tutorials but none seemed work when porting over.

Here's what I got : http://img242.imageshack.us/my.php?image=explosionmi0.swf (click to make explosions)

I basically create a random Z velocity and base scale off that Z position. It seems like the scale is working fine, but as you can see, something is bit off. I'm guess it's because I dont change the X and Y coordinates based on scale. I saw a few examples on how to do this but when applying that technique I always get wacky results. Here's (http://www.kirupa.com/forum/attachment.php?attachmentid=26097&d=1120671767) a better example of how a 3d explosion should look.

Lastly, here's a glipse of what I'm doing :
var scaleRatio = FocalLength/(FocalLength + Objects[i].positionz);
//add velocity to Z position
Objects[i].positionz += Objects[i].velocityz;
//Render
Objects[i].scaleX = scaleRatio;
Objects[i].scaleY = scaleRatio;

I can upload the whole class file if needed.

Felixz
April 20th, 2008, 10:08 AM
u could try papervision (http://papervision3d.org)
And to increase performance, try working on bitmaps

substance
April 20th, 2008, 01:56 PM
u could try papervision (http://papervision3d.org)
And to increase performance, try working on bitmaps

I'm just trying to create the simple illusion of 3D, papervision is an actualy bonified 3D engine (per say). Also I know how to work with bitmapdata however for the sake of simplicity I chose to work with vector mc's instead.

substance
April 20th, 2008, 09:14 PM
Got it. http://img501.imageshack.us/my.php?image=explosionpe2.swf

Source attatched if anyone wants to peek.