Stardust Particle Effects – X-Wing Demo

Standard

Stardust X-Wing demo

The aim of this demo was to update John Grden’s legendary Papervision3D X-Wing model – as seen in this classic papervision demo – and really bring it to life with some nice animated 3D particle effects.

The demo combines Papervision3D and the Stardust Particle Engine to add particle effects to the existing 3D model. I used Stardust’s built in Papervision extension to add the classic red glow of the X-Wing engines and then animate those engines as the ship accelerates away from camera. It’s quite a subtle effect, but if you look closely you can see a kind of red heat haze, I also like the way the white flames fade in and out as the ship speeds up and slows down.

I know this kind of effect could easily be done in something like Unity but I think it’s pretty cool to see it done in real-time in Flash. The original Papervision3D X-Wing demos were a real inspiration to me, and it’s amazing just how much a little effect like this can add to what is already an amazing 3D model.

Click here to view the demo and source code.

VizualPV3DPhysics – combining VizualPV3D with JigLibFlash

Standard

Following on from my earlier post about loading xml from a VizualPV3D scene into Papervision3D, this class extends VizualPV3DLoader by adding some basic integration with the brilliant JigLibFlash 3D physics engine.

At the moment it is really more of a tech demo than a fully featured class, but it shows potential and I thought it might be useful to post it here. The class takes any cubes that are listed in the scene xml and turns them into physics objects using JigLibFlash, creating a set of static surfaces that could be used as the backdrop for your project. You can then create extra physics objects manually in ActionScript and add them into the scene as well.

So what could you do with this? Well theoretically it might be possible to make a simple 3D game using VizualPV3D to build the levels out of cubes, then animate parts of each level to make moving platforms or doors, before adding other more interactive elements like enemies or a player character using some extra ActionScript.

For more inspiration, there are some really cool JigLibFlash demos over on the project’s main blog, which are definitely worth checking out.

Here’s an example of how you might use the class in a project.

//include the class
import me.pv3d.VizualPV3DPhysics;

//elsewhere add it to your physics enabled papervision3d scene
var light:PointLight3D = new PointLight3D(); //light
var physics:Papervision3DPhysics = new Papervision3DPhysics(scene, 5);
var pv3d:VizualPV3DPhysics = new VizualPV3DPhysics('./assets/', light, physics);
pv3d.load('scene.xml');
scene.addChild(pv3d);

//then when the scene has loaded access objects by name and move them about
var mybox:RidgidBody = pv3d.getPhysicsBodyByName("mybox");
mybox.y += 10;

Here’s a very simple demo based on the game idea above, links to the demo and source code are below.

demo4-physics

View demo and download source code

VizualPV3DPhysics

VizualPV3DLoader – a class for loading VizualPV3D scenes into Papervision3D projects

Standard

If you haven’t yet seen it, VizualPV3D is the excellent GUI interface from Juxt Interactive for creating 3D scenes using Papervision3D. It’s currently in alpha, but definitely worth checking out as it already has loads of great features and makes creating complex 3D scenes in Flash very easy indeed.

Having played around with the program for a while I then wanted to import the scenes I’d created into a new AS3 project but couldn’t find any classes included to do that. I think these features may be added in a future version, but for now I wanted something simple and reusable to try and get the geometry and materials of the scene imported quickly, so I wrote a basic class to do just that.

The class is called VizualPV3DLoader and currently supports the following: basic primitive shapes (cube, cylinder, cone, sphere and plane), basic materials (wireframe, flatshade, cellshade, gourad and phong), external BitmapAssetMaterial’s, positioning elements in the 3d scene and grouping elements together within empty DisplayObject3D containers.

The class itself extends DisplayObject3D, so you can add it straight into your main scene. From there you can access all the groups and objects in it by name. I’m looking at adding in a few more features in the future, including: more materials, text3D support and maybe event integration with a physics library.

Usage is fairly easy…

//include the class
import me.pv3d.VizualPV3DLoader;
//elsewhere add it to your papervision3d scene
var vLoader:VizualPV3DLoader = new VizualPV3DLoader('assets/', light);
vLoader.load('scene.xml');
scene.addChild(vLoader);

The constructor takes a couple of parameters, the first is for the assets directory (where your external textures are stored) and the second is for an instance of PointLight3D for use with any shaded materials. You can also add a listener for a VizualPV3DEvent.SCENE_READY event, which might be useful if its a really complex scene that takes a while to process.

Below is a screen grab of a simple demo I made with the class and a link to view the demo and download the source code, maybe someone will find it useful.

VizualPV3DLoader - View Demo and Source Code

View Demo and Source Code