//create a box with size 1x1x1 (width x length x height) at point 0,0,0 //define the vertex list of the box with 8 points var VertexList = [ [0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1] ]; //Each face consists by 4 boundary points //in the facelist we define each vertex of face by the index in the VertexList (First index is 1) //The fith item in each face represents the color index from document Palette. If it is -1 the vdPolyface color will be used. //If the vertex index is negative then the edge that begins with this vertex will be invisible in wire render mode. var FaceList = [ 1, 2, 3, 4, 1,//first face from indexes 1,2,3,4 and Color index 1. 5, 6, 7, 8, 2,//2nd face from indexes 5, 6, 7, 8 and Color index 2. 1, 2, 6, 5, 3, 2, 3, 7, 6, 4, 3, 4, 8, 7, 5, 4, 1, 5, 8, 6 ]; vdcanvas.AddPolyface(VertexList, FaceList, true); |