Flint Particle System with Papervision3D
Flint -> http://flintparticles.org/
Flint is very cool. It just has a bit of a learning curve (as does Papervision3D). Here’s a “Hello Word” example that I hope will help. There are MANY other options that I’m not covering here. This is just about as simple as it gets with still having some kind of movement.
package { import org.flintparticles.common.actions.Action; import org.flintparticles.common.actions.Age; import org.flintparticles.common.counters.Steady; import org.flintparticles.common.initializers.Lifetime; import org.flintparticles.threeD.actions.Move; import org.flintparticles.threeD.actions.RandomDrift; import org.flintparticles.threeD.emitters.Emitter3D; import org.flintparticles.threeD.geom.Vector3D; import org.flintparticles.threeD.initializers.Position; import org.flintparticles.threeD.initializers.Velocity; import org.flintparticles.threeD.papervision3d.PV3DRenderer; import org.flintparticles.threeD.papervision3d.initializers.PV3DObjectClass; import org.flintparticles.threeD.zones.PointZone; import org.flintparticles.threeD.zones.Zone3D; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.view.BasicView; [SWF(width="640", height="480", backgroundColor="#000000", frameRate="60")] public class Papervision3DWithFlint extends BasicView { private const NUM_SPHERES_PER_SECOND:Number = 1; private var emitter:Emitter3D; private var pv3dRenderer:PV3DRenderer; public function Papervision3DWithFlint() { emitter = new Emitter3D(); emitter.counter = new Steady(NUM_SPHERES_PER_SECOND); //initializers var displayObject3dType:PV3DObjectClass = new PV3DObjectClass(Sphere); emitter.addInitializer(displayObject3dType); var starting3DPosition:Vector3D = new Vector3D( 0, -700, 0); var starting3DZone:Zone3D = new PointZone(starting3DPosition); var startingPosition:Position = new Position(starting3DZone); emitter.addInitializer(startingPosition); var direction:Vector3D = new Vector3D(0, 100, 0); var zone:Zone3D = new PointZone(direction); var velocity:Velocity = new Velocity(zone); emitter.addInitializer(velocity); var lifetime:Lifetime = new Lifetime(20); emitter.addInitializer(lifetime); //actions var ageAction:Action = new Age(); emitter.addAction(ageAction); var moveAction:Action = new Move(); emitter.addAction(moveAction); var drift:Action = new RandomDrift(1000, 0, 1000); emitter.addAction( drift ); //Flint renderer matches emitter 3d coordinates to pv3d coordinates //*does not actually render the pv3d scene* pv3dRenderer = new PV3DRenderer(scene); pv3dRenderer.addEmitter(emitter); //start emitter emitter.start(); //start pv3d rendering startRendering(); } } }
No comments yet.
Leave a comment
Search
Recent Posts
- MorphController - Mighty Morphing Papervision3D
- End dump
- Test if a plane is within the view of the camera (aka testing if culled)
- Materials Reference
- Perlin Blob
- Dynamic Text on a Plane
- Maya Texture Baking
- Creating a Custom VectorVision Font
- Workshop video and example dump
- 3D Math Book Recommendation
- Heading to New York. brb ;)
- Launching Flex4.org
- Flex 4 Layouts and Groups
- Flex 4 States
- How to click on stuff in Papervision3D - Viewport, ViewportLayers, InteractiveScene3DEvent, Mouse3D, and MovieMaterial Buttons
Recent Comments
- alexxcz on MorphController - Mighty Morphing Papervision3D
- andre venancio on 3D Math Book Recommendation
- DS on Dynamic Text on a Plane
- John Lindquist on Maya Texture Baking
- Itai on Maya Texture Baking
- Javier on End dump
- samBrown on End dump
- tf on archive
- Pan on requests
- Martin Lindelöf on requests

