Away 3 D(五):Primitives(Part 1)
The Triangle:
The Plane:
The Cube:
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});