The struggles with PV3D continue. This time I'm stuck on resolving this error: [quote]WARNING: Required material not found in given materials list. Supported materials are: front, back, right, left, top, bottom & all.[/code]
It comes right after trace(4), but I can't figure out what to do to fix it. Any suggestions as to what might be going wrong? Even better, any ideas for a solution? Danke.
public static function get doublesidedplane():Cube{
/**In order to apply materials to a cube you must filter your
* materials through a MaterialsList Object. In the MaterialsList
* Object you will define the material that will be applied to each
* face of the cube and each material you apply will be flagged with
* "front", "bottom", "left", etc...
**/
trace(1);
var matFront:MovieMaterial = new MovieMaterial(new Front(), true);
var matBack:MovieMaterial = new MovieMaterial(new Back(), true);
trace(2);
matFront.allowAutoResize = false;
matFront.animated = true;
trace(3)
var materialsList : MaterialsList = new MaterialsList();
materialsList.addMaterial(matFront, "front");
materialsList.addMaterial(matBack, "back");
trace(4);
// cube = new Cube(MaterialList applied to object, width, depth, height, wSeg, dSeg, hSeg);
return new Cube(materialsList, 360, 0, 97, 6, 6, 6);
}
// edit: using Papervision3D Public Beta 2.0 - Great White (December 3rd, 2008)
Think I worked it out. It appears as though when creating a cube, it's not enough to set materials for just one or two sides - you have to do it for all six: front, back, right, left, top, and bottom.
yeah def.
you may or may not know this but ya can exclude faces so they do not render. You still might still have to put in some garbage materiasl in the sides you do not use, but you can do this in the cube init
var myCube = new Cube( myMaterial , myWidth, myDepth , myHeight, 1,1,1,Cube.NONE , Cube.TOP+Cube.BOTTOM+Cube.RIGHT+Cube.LEFT);
Cube.NONE refers to the interior
and the second param of:
Cube.TOP+Cube.BOTTOM+Cube.RIGHT+Cube.LEFT
refer to the sides you exclude.
Sweet. Thanks for the extra bits!
