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(); } } }
-
Michael Iv
-
Jemi
Search
Recommended Books
Speaking at FITC Toronto
Recent Posts
- Moving to johnlindquist.com
- AsyncCommand with Robotlegs, Signals, Flight, MinimalComps
- Search Widget – Robotlegs, Signals, Flight, Minimal Comps, Yahoo Astra
- FDT Super Awesome March Deal
- haXe Tutorial
- AS3 Signals Tutorial
- Preferred Video Tutorial Resolution?
- TweenMax – Tweening a timeline (Advanced Tweening)
- Robotlegs + Flight + Union Platform
- Back in the saddle
- Eclipse Theme Designer Preview
- RobotLegs Hello World Video Tutorial
- 10 Things Every Senior Flash Developer Should Know
- Efflex – 3D Effects for Flex
- MorphController – Mighty Morphing Papervision3D
Recent Comments
- Xdragosy on Ribbons
- As on What is BasicView?
- Godie_dito on Dynamic Text on a Plane
- Angel Kaido on Following line
- bambii7 on faq
- Felipe on TweenMax – Tweening a timeline (Advanced Tweening)
- Ocatarinabelachichix on about
- Rajiv on faq
- Rajiv on 3ds max texture baking for Papervision3D
- Anupam Biswas on Maya Texture Baking
Categories
Archives
Preferred Video Tutorial Resolution
- 1024x768 (53%, 85 Votes)
- 1280x1024 (15%, 24 Votes)
- 1920x1080 (15%, 24 Votes)
- 800x600 (13%, 20 Votes)
- 480x320 (4%, 6 Votes)
- 640x480 (0%, 2 Votes)
Total Voters: 160


