본문 바로가기

AS3/PV3D

패이퍼비전 3D 기초 - 02

package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.view.BasicView;
	
	public class chapter02 extends Sprite
	{

		private var view:BasicView;
		private var sphere:Sphere;
		
		public function chapter02()
		{
			// 3D 환경설정
			view = new BasicView( 550, 400 );
			view.camera.zoom = 150;			
			this.addChild( view );
			//객체 생성
			sphere  =  new Sphere( null,100 );
			view.scene.addChild( sphere );
			
			//랜더링 
			this.addEventListener( Event.ENTER_FRAME, onEnter );
		}
		
		private function onEnter(event:Event):void
		{
			sphere.rotationY += 2;
			view.singleRender();
		}
		
	}
}

'AS3 > PV3D' 카테고리의 다른 글

패이퍼비전 3D 기초 - 06  (0) 2010.11.19
패이퍼비전 3D 기초 - 05  (0) 2010.11.19
패이퍼비전 3D 기초 - 04  (0) 2010.11.19
패이퍼비전 3D 기초 - 03  (0) 2010.11.19
패이퍼비전 3D 기초 - 01  (0) 2010.11.19