본문 바로가기

AS3/PV3D

패이퍼비전 3D 기초 - 03

package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import org.papervision3d.materials.ColorMaterial;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;
	
	public class chapter03 extends Sprite
	{

		private var view:BasicView;
		private var material:ColorMaterial;

		private var plane:Plane;
		public function chapter03()
		{
			// 3D 환경설정
			view = new BasicView( 550, 400 );
			this.addChild( view );
			
			// 객체 생성 및 Material 생성
			material = new ColorMaterial( 0xFF0000, 0.2 );
			material.doubleSided = true;
			plane = new Plane( material );
			view.scene.addChild( plane );
			
			// 랜더링
			this.addEventListener(Event.ENTER_FRAME, onEnter );		
		}
		
		private function onEnter(event:Event):void
		{
			plane.rotationY += 3;
			view.singleRender();
		}
		
	}
}

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

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