============
http://away3d.com/examples.php?example=40&_searchterm=;
============
// import core library
import away3d.containers.*;
// import geometry primitives
import away3d.primitives.*;

// create a 3D-viewport
var view:View3D = new View3D({x:300, y:300});
// add viewport to the stage
addChild(view);

// create a sphere
var sphere = new Sphere({material:"blue#cyan", radius:250, segmentsW:
12, segmentsH:9, y:25, x:10, z:10});
// add the sphere to the scene
view.scene.addChild(sphere);

// point camera at the sphere
view.camera.lookAt(sphere.position);

// every frame
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
        // rotate sphere around the Y-axis
        sphere.rotationY = getTimer() / 100;
        // rerender viewport on each frame
        view.render();
}

Reply via email to