안녕하세요 마린즈입니다.
3편에서 만든 기본클래스를 활용하여, 기본도형들을 화면에 만들어보도록 하겠습니다
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
package { import flash.events.Event; import flash.text.TextFieldAutoSize; import flash.text.TextField; import flash.system.System; import org.papervision3d.core.math.Number3D; import org.papervision3d.materials.BitmapAssetMaterial; import org.papervision3d.materials.BitmapFileMaterial; import org.papervision3d.objects.primitives.Cone; import org.papervision3d.objects.primitives.Plane; /** * ... * @author marines */ public class PrimitiveBase extends BootStrap { protected var sceneWidth:Number; protected var sceneHeight:Number; private var cone:Cone = new Cone(); public function PrimitiveBase() { if (stage) initApp(); else addEventListener(Event.ADDED_TO_STAGE, initApp); } private function initApp(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, initApp); // entry point sceneWidth = stage.stageWidth; sceneHeight = stage.stageHeight; init(sceneWidth, sceneHeight); } override protected function init3d():void { cone.pitch( -10); cone.scale = 3; scene.addChild(cone); } override protected function processFrame():void { cone.yaw(3); } } } |