In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

PV3Dでパーティクル回転

...
@author
Get Adobe Flash player
by _azzip 21 Feb 2010
/**
 * Copyright _azzip ( http://wonderfl.net/user/_azzip )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9TSp
 */

package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import flash.geom.Point;
	
	import org.papervision3d.objects.primitives.*;
	import org.papervision3d.objects.special.*;
	import org.papervision3d.objects.*;
	import org.papervision3d.materials.*;
	import org.papervision3d.materials.special.*;
	import org.papervision3d.core.render.filter.*;
	import org.papervision3d.view.*;
	import org.papervision3d.cameras.*;
	import org.papervision3d.lights.*;
	import org.papervision3d.core.math.*;
	import org.papervision3d.core.utils.*;
	import org.papervision3d.events.*;
	import org.papervision3d.core.geom.*;
	import org.papervision3d.core.effects.*;
		
	
	/**
	 * ...
	 * @author 
	 */
	public class Main extends BasicView 
	{
		private var particles:ParticleField;
		
		
		public function Main() 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		//
		//-------------------------------------
		//  init
		//-------------------------------------
		private function init(e:Event = null):void 
		{
			stage.align = "TL";
			stage.scaleMode = "noScale";
			

			var material:ParticleMaterial = new ParticleMaterial(0xFF0000, 1, 1, 4);
			
			particles = new ParticleField(material, 500, 2, 2000, 2000, 2000);
			scene.addChild(particles);
			
			startRendering();
			
			
			addEventListener(Event.ENTER_FRAME, enterHandler);
			
		}
		
		private function enterHandler(e:Event):void 
		{
			var mouseP:Point = new Point(stage.mouseX,stage.mouseY);
			mouseP.offset(-stage.stageWidth/2,-stage.stageHeight/2);
			particles.rotationY += mouseP.y/40;
			particles.rotationX += mouseP.x/40;	

			
		}
		
	}
}