package
{
import flash.display.Sprite;
import flash.events.Event;
import away3d.containers.View3D;
import away3d.entities.Mesh;
import away3d.materials.ColorMaterial;
import away3d.primitives.CubeGeometry;
import away3d.utils.Cast;
/**
*
* @author mengtianwxs
* @createTime 2013-7-3
*/
public class taway extends Sprite
{
private var view:View3D;
[Embed(source="n.jpg")]
private var bmp:Class;
private var cube:CubeGeometry;
//@away3d 4.1.1
//@tool fb4.7
public function taway()
{
view=new View3D();
addChild(view);
//从这里设置视图中的背景图片
view.background=Cast.bitmapTexture(bmp);
//从这里设置视图中的背景颜色
//view.backgroundColor=0xffffff;
cube=new CubeGeometry();
view.scene.addChild(new Mesh(new CubeGeometry(),new ColorMaterial()));
addEventListener(Event.ENTER_FRAME,update);
}
protected function update(event:Event):void
{
// TODO Auto-generated method stub
view.render();
}
}
}
你可以通过view3d类设置视图的抗锯齿(antiAlias)能力其有效值是0,2,4,16缺省为0,背景颜色以及图片(如代码)。
如果你想关闭右键菜单的away3d版本信息以及viewSource(假设你通过addSourceURL()方法设置了相应的url地址),你可以设置view.rightClickMenuEnabled=false;
标签:View3D,Away3D,CubeGeometry,视图,away3d,import,new,view From: https://blog.51cto.com/u_15932543/5994474