본문으로 바로가기

papervision3D tutorial

category 코딩공부/Flash 2015. 3. 31. 12:32

Papervistion3D


DisplayObjectContainer3D : addChild, removeChild, numChildren


DisplayObject3D : x,y,z, rotationX, rotationY, rotationZ, ==> 플래시의 Sprite 같은 개념



papervistion3D 의 default 설정


papervision 3D, away 3D, ==> stage3D 가 대세


papervision3D는 공부용으로 사용됨



package

{


public class PV3Dtest extends Sprite

{

private var viewPort : Viewport3D = new Viewport3D(550,400);


private var camera : Camera3D = new Camera();


private var scene : Scene3D = new Scene();


private var renderEngine : BasicRenderEngine;


public function Pv3Dtest()

{

addChild(viewPort);


camara.zoom = 40;


sphere = new Sphere();


scene.add child(sphere);


addEventListener( Event.ENTER_FRAME, onEnter);


}


private function onEnter( e: Event) :void

{

sphere.rotationX +=2;

sphere.rotationY +=3;

renderEngine.renderScene( scene, camera, viewPort);

}


}

}




댓글을 달아 주세요