Flint Pixels
package { import flash.events.Event; import flash.filters.BlurFilter; import org.flintparticles.common.actions.Age; import org.flintparticles.common.counters.Steady; import org.flintparticles.common.initializers.ColorInit; import org.flintparticles.common.initializers.Lifetime; import org.flintparticles.threeD.actions.Accelerate; import org.flintparticles.threeD.actions.Move; import org.flintparticles.threeD.emitters.Emitter3D; import org.flintparticles.threeD.geom.Vector3D; import org.flintparticles.threeD.initializers.Velocity; import org.flintparticles.threeD.papervision3d.PV3DPixelRenderer; import org.flintparticles.threeD.zones.DiscZone; import org.papervision3d.core.effects.BitmapLayerEffect; import org.papervision3d.core.geom.Pixels; import org.papervision3d.view.BasicView; import org.papervision3d.view.layer.BitmapEffectLayer; [SWF(width="640", height="480", backgroundColor="#000000", frameRate="60")] public class FlintPixels extends BasicView { private var emitter:Emitter3D; private var flintRenderer:PV3DPixelRenderer; private var bitmapEffectLayer:BitmapEffectLayer; private var pixels:Pixels; public function FlintPixels() { camera.z = -300; setupPixels(); setupEmitter(); setupFlintRenderer(); emitter.start(); startRendering(); } private function setupPixels():void { bitmapEffectLayer = new BitmapEffectLayer(viewport); viewport.containerSprite.addLayer( bitmapEffectLayer ); pixels = new Pixels(bitmapEffectLayer); bitmapEffectLayer.addDisplayObject3D(pixels); scene.addChild(pixels); bitmapEffectLayer.addEffect(new BitmapLayerEffect(new BlurFilter(2, 2, 1))); } private function setupEmitter():void { emitter = new Emitter3D(); emitter.counter = new Steady( 500 ); emitter.addInitializer(new ColorInit(0xffcc0000, 0xffffffff)); emitter.addInitializer(new Velocity(new DiscZone(new Vector3D(0, 340, 0), new Vector3D(0, 1, 0), 100, 100))); emitter.addInitializer(new Lifetime(3)); emitter.addAction(new Move()); emitter.addAction(new Accelerate(new Vector3D(0, -300, 0))); emitter.addAction(new Age()); } private function setupFlintRenderer():void { flintRenderer = new PV3DPixelRenderer(pixels); flintRenderer.addEmitter(emitter); } override protected function onRenderTick(event:Event = null):void { pixels.rotationY += (viewport.containerSprite.mouseX - pixels.rotationY) * .3; pixels.rotationX += (viewport.containerSprite.mouseY - pixels.rotationX) * .3; renderer.renderScene(scene, camera, viewport); } } }
5 Comments to Flint Pixels
Uber impressive!
great example!
flint is absolutely awesome!
(further…the spreading cone is very similar to a thong… great job john! :D)
December 22, 2008
@Piergiorgio - Just don’t tell me what you built with the physics examples.
Wow, this is awesome.
By the way thanks for all the tutorials and happy xmas. Here is an addictive xmas snowball game for you:
http://www.mentordigital.co.uk/xmas
I will try and add the flint particles if I have time! Any idea how you can speed up the blur filter so it dissapears faster in this example?
Holland
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

December 22, 2008