cheers Fabrice,
just what I needed to get me going. I've got it working, and seems to
be fine - although im quite sure my method of trial and error is not
the best way... Once I found the top faces, I noted them, and deleted
them. I then created the new 4 faces based on the old two, and went
through each of the new faces changing the vertices until everything
lined up. Next I cycled through the vertices of the cube, and slotted
these into my new faces where they matched.
I'm now wondering if there is likely to be any issues with the way I
have done it? as Im after as much performance as possible. Or is there
a better way of doing this? thanks.
pointedCube = new Cube( { width:200, height:200, depth:200 } );
view.scene.addChild(pointedCube);
pointedCube.removeFace(pointedCube.faces[8]);
pointedCube.removeFace(pointedCube.faces[8]); //originally face 9
var pointheight:Vertex = new Vertex(0, pointedCube.height, 0); //
Vertex for Point
var one:Face = new Face(pointedCube.vertices[2], pointedCube.vertices
[6], pointheight,new ColorMaterial(0xff0000));
var two:Face = new Face(pointedCube.vertices[0], pointheight,
pointedCube.vertices[5],new ColorMaterial(0x00ff00));
var three:Face = new Face(pointedCube.vertices[2], pointheight,
pointedCube.vertices[0],new ColorMaterial(0x0000ff));
var four:Face = new Face(pointheight, pointedCube.vertices[6],
pointedCube.vertices[5],new ColorMaterial(0xccff00));
pointedCube.addFace(one);
pointedCube.addFace(two);
pointedCube.addFace(three);
pointedCube.addFace(four);