TwelvestoneFlash

PV3D: Required material not found in given materials list


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
baron ruhstoff
 
2009-03-18

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)

baron ruhstoff
 
2009-03-18

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.

pyrogen
 
2009-03-18

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.

baron ruhstoff
 
2009-03-18

Sweet. Thanks for the extra bits!

pyrogen
 
2009-03-19

k

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

PV3D: Required material not found in given materials list