PV3Dでパーティクル回転 ... @author _azzip forked:1favorite:10lines:46license : MIT License modified : 2010-02-22 01:58:42 Embed Tweet 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; } } } Code Fullscreen Preview Fullscreen Ryogo_Qubere.. site maccyan hacker_ufpu0.. termat djankey hacker_xdv5g.. siouxcitizen.. norichika2 zawa init addChild Event.ENTER_FRAME particles rotationY rotationX material stage addEventListener offset mouseY Event.ADDED_TO_STAGE mouseX Point Event addChild Event.ENTER_FRAME sort new page view favorite forked pv1771 forked from: PV3Dでパーティクル回転 uwi forked:2 favorite:5lines:86 (diff:45)