papervision3dものすごく基本
♥0 |
Line 27 |
Modified 2009-12-29 23:35:05 |
MIT License
archived:2017-03-20 10:40:39
ActionScript3 source code
/**
* Copyright norichika2 ( http://wonderfl.net/user/norichika2 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/oBDT
*/
package
{
import flash.events.Event;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.view.*;
import org.papervision3d.materials.*;
public class Main extends BasicView
{
//ワイヤーマテリアル作成
var material:WireframeMaterial = new WireframeMaterial(0x000000);
//球体作成
var sphere:Sphere = new Sphere(material,400,20,20);
public function Main()
{
scene.addChild(sphere);
sphere.x = 100;
sphere.y = 50;
sphere.z = 20;
sphere.localRotationX = 20;
startRendering();
addEventListener(Event.ENTER_FRAME, loop);
}
private function loop(e:Event):void
{
sphere.localRotationX += 5;
sphere.localRotationZ -= 3;
}
}
}