아래 코드는 원형 구체를 X축 방향으로 돌리는 예제 입니다. 간결하면서도 확실하게 눈에 쏙 들어오는 코드 ^_^
//Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
creationComplete="init()"
frameRate="40"
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import sample.BasicViewExample;
import mx.core.UIComponent;
private function init():void{
var bs:BasicViewExample = new BasicViewExample();
var ui:UIComponent = new UIComponent();
ui.addChild(bs);
this.addChild(ui);
}
]]>
</mx:Script>
</mx:Application>
//BasicViewExample.as
package sample
{
import flash.events.Event;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.view.BasicView;
public class BasicViewExample extends BasicView
{
private var _sphere:Sphere;
public function BasicViewExample()
{
_sphere = new Sphere();
scene.addChild(_sphere);
startRendering();
}
override protected function onRenderTick(event:Event=null):void{
_sphere.localRotationX += 1;
super.onRenderTick();
}
}
}
'etc > old' 카테고리의 다른 글
[ PV3D ] 3-2 Primitives - Plane (0) | 2009.10.10 |
---|---|
[ PV3D ] 3-1 Primitives 기본모델? (0) | 2009.10.10 |
[ PV3D ] 2-2 기초 예제 1 (0) | 2009.10.08 |
[ PV3D ] 2-1 PV3D기본 SCENE, CAMERA, VIEWPORT ... (0) | 2009.10.08 |
[ PV3D ] 1-1 환경설정 (0) | 2009.10.08 |