Away3D(五):Primitives(Part 1)

The Triangle:

var tri:Triangle = new Triangle();
tri.a = new Vertex(0,200,0);
tri.b = new Vertex(100,0,0);
tri.c = new Vertex(-100,0,0);
tri.bothsides = true;
view.scene.addChild(tri);

 

The Plane:

// white是网格填充色,black是线框颜色
var myPlane:Plane = new Plane({material:"white#black",rotationX:-90});
View.scene.addChild(myPlane);

var mat:WireColorMaterial = new WireColorMaterial();
mat.color = 0xff0000;
mat.wirecolor = 0x000000;
var myPlane:Plane = new Plane();
myPlane.material = mat;
myPlane.rotationX = -90;
View.scene.addChild(myPlane);

// 细节层次
myPlane.segmentsW = 4;
myPlane.segmentsH = 6;

var cPlane:Plane = new Plane({material:cTex,width:200,height:200,bothsides:true,z:0,ownCanvas:true});
cPlane.rotationX = 90;
cPlane.rotationY = 180;
// ownCanvas 为 true 才能使用 blendMode
cPlane.blendMode = BlendMode.MULTIPLY;
View.scene.addChild(cPlane);

 

The Cube:

cube = new Cube({width:200,height:100,depth:300});

var cube:Cube = new Cube();
cube.width = 200;
cube.height = 100;
cube.depth = 300;

// 更改其中一面的材质,并设置透明度
cube.cubeMaterials.left = new ColorMaterial(0xffffff,{alpha:.3});
 

你可能感兴趣的:(C++,c,C#)