package com.zeronine.basicSphere
{
import away3d.containers.View3D;
import away3d.materials.ColorMaterial;
import away3d.materials.WireColorMaterial;
import away3d.primitives.Sphere;
import flash.display.Sprite;
import flash.events.Event;
public class BasicSphere extends Sprite
{
private var _view:View3D;
private var _basicSphere:Sphere;
public function BasicSphere()
{
viewSet();
objectSet();
}
private function objectSet():void
{
_basicSphere = new Sphere();
_basicSphere.radius = 100;
_basicSphere.material = new WireColorMaterial(0xff0000);
_view.scene.addChild(_basicSphere);
}
private function viewSet():void
{
_view = new View3D();
_view.x = stage.stageWidth / 2;
_view.y = stage.stageHeight / 2;
this.addChild(_view);
addEventListener(Event.ENTER_FRAME, engine);
}
private function engine(e:Event):void
{
_view.render();
_basicSphere.rotationY += 2;
}
}
}
{
import away3d.containers.View3D;
import away3d.materials.ColorMaterial;
import away3d.materials.WireColorMaterial;
import away3d.primitives.Sphere;
import flash.display.Sprite;
import flash.events.Event;
public class BasicSphere extends Sprite
{
private var _view:View3D;
private var _basicSphere:Sphere;
public function BasicSphere()
{
viewSet();
objectSet();
}
private function objectSet():void
{
_basicSphere = new Sphere();
_basicSphere.radius = 100;
_basicSphere.material = new WireColorMaterial(0xff0000);
_view.scene.addChild(_basicSphere);
}
private function viewSet():void
{
_view = new View3D();
_view.x = stage.stageWidth / 2;
_view.y = stage.stageHeight / 2;
this.addChild(_view);
addEventListener(Event.ENTER_FRAME, engine);
}
private function engine(e:Event):void
{
_view.render();
_basicSphere.rotationY += 2;
}
}
}
'ActionScript3.0 > Away3d 3' 카테고리의 다른 글
Away3d_Cylineder(); (0) | 2010.11.29 |
---|---|
Away3d_Cube(); (0) | 2010.11.29 |
Away3d_Cone(); (0) | 2010.11.29 |
Away3d_Plane(); (0) | 2010.11.29 |
Away3d _ view3D(); (0) | 2010.11.29 |