package { import away3d.cameras.HoverCamera3D; import away3d.containers.View3D; import away3d.primitives.GeodesicSphere; import flash.display.Sprite; import flash.events.Event; [SWF(width="500", height="200", frameRate="50", backgroundColor="#FFFFFF")] public class ExGeodesicsphereRefine extends Sprite { private var cam:HoverCamera3D; public var View:View3D; private var geoSphere1:GeodesicSphere; private var geoSphere2:GeodesicSphere; private var geoSphere3:GeodesicSphere; private var geoSphere4:GeodesicSphere; public function ExGeodesicsphereRefine() { // create a "hovering" camera cam = new HoverCamera3D(); cam.z = -1000; // make sure the camera is positioned away from the default 0,0,0 coordinate cam.panAngle = 0; cam.tiltAngle = 0; cam.hover(true); cam.minTiltAngle = -90; cam.zoom = 5; // create a viewport View = new View3D({camera:cam,x:250,y:100}); addChild(View); // add 4 spheres with varying amount of "fractures" geoSphere1 = new GeodesicSphere({radius:90,x:340}); geoSphere1.fractures = 0; geoSphere1.invertFaces(); View.scene.addChild(geoSphere1); geoSphere2 = new GeodesicSphere({radius:90,x:130}); geoSphere2.fractures = 1; geoSphere2.invertFaces(); View.scene.addChild(geoSphere2); geoSphere3 = new GeodesicSphere({radius:90,x:-80}); geoSphere3.fractures = 2; geoSphere3.invertFaces(); View.scene.addChild(geoSphere3); geoSphere4 = new GeodesicSphere({radius:90,x:-290}); geoSphere4.fractures = 3; geoSphere4.invertFaces(); View.scene.addChild(geoSphere4); this.addEventListener(Event.ENTER_FRAME,update); } public function update(e:Event):void { geoSphere1.rotationX += 1; geoSphere2.rotationX += 1; geoSphere3.rotationX -= 1; geoSphere4.rotationX += 1; // render the view cam.hover(); View.render(); } } }