away3D四种球体的样式实例

/*在fb下新建as项目运行此实例*/
Four_Ball.as
package {
	import away3d.containers.View3D;    //视口类
	import away3d.materials.WireColorMaterial;
	import away3d.materials.ColorMaterial;
	import away3d.primitives.Sphere;
	
	import flash.display.Sprite;
	
	[SWF(width="1200", height="500", frameRate="60", backgroundColor="#FFFFFF")]
	
	public class Four_Ball extends Sprite{
		public function Four_Ball(){
			var view:View3D = new View3D({x:250, y:100});
			addChild(view);
			//第一个球
			var sphere1:Sphere = new Sphere({material:"orange#red", x:-110});    //material:材质,填充颜色#边框颜色
			view.scene.addChild(sphere1);
			//第二个球
			var colorMaterial:WireColorMaterial = new WireColorMaterial();
			colorMaterial.color = 0x00FF00;    //球的填充颜色
			var sphere2:Sphere = new Sphere();
			sphere2.x = 110;
			sphere2.material = colorMaterial;
			view.scene.addChild(sphere2);
			//第三个球
			var sphere3:Sphere = new Sphere({material:"blue",x:350});
			view.scene.addChild(sphere3);
			//第四个球
			var colorMaterial4:ColorMaterial = new ColorMaterial();
			colorMaterial4.color = 0xFF00FF;
			var sphere4:Sphere = new Sphere();
			sphere4.x = 600;
			sphere4.material = colorMaterial4;
			view.scene.addChild(sphere4);
			view.render();
		}
		
	}
}


你可能感兴趣的:(Flash)