“Be inspired, enjoy your work, keep learning and never forget to play.” — gskinner

Double-faced Plane (or Cube with depth=1) in Papervision3D

Posted: October 11th, 2007 | Author: nuno | Filed under: Actionscript3, Code, Experiments, Papervision3d, Tutorial | 5 Comments »

Today I had my first experiments with Papervision3D and after some time playing around I wanted to try having a double-faced Plane() with a different material on each face.

Its likely that a better way to do this exists, but one way to emulate a double-faced Plane() is to have a Cube with depth = 1, and hiding all but the front and back faces. Here's a and the code.

The hint to do this was from ldoru and the car in the images too!

 Update:  I would not longer use such an approach to achieve a double-faced Plane() with a different material on each face. I would recommend using a DisplayObject3D with two normal one-face planes inside it.


5 Comments on “Double-faced Plane (or Cube with depth=1) in Papervision3D”

  1. 1 Komputersystem said at 8:47 pm on December 28th, 2007:

    Hey, I’ve got PV3D 1.5 and desperately trying to get this thing running but for some reason Cube doesnt like the materials object. Its throwing a conversion error 1034.

    Any ideas?

  2. 2 Idoru said at 8:54 pm on December 29th, 2007:

    Hey,
    What’s the exact error?
    Usually a conversion error is self explainatory.

  3. 3 Sean said at 7:21 am on March 11th, 2008:

    I had that error too, although I’m now running Papervision3D 2.0

    Anyway, the problem was that I was giving it a Material instead of a MaterialsList.

    var obj_mat = new ColorMaterial(0xFF0000);
    var obj_mat_list = new MaterialsList;
    // you can specify just ‘back’, ‘front’ etc below
    obj_mat_list.addMaterial(obj_mat, ‘all’);
    var obj = new Cube(obj_mat_list, 200, 1, 100, 10, 10, 10);

  4. 4 Ohm said at 5:02 pm on March 13th, 2008:

    Hi,

    same for me…
    the error is that it can’t convert a MaterialList to a MaterialObject3D…
    would you have a version of this example I’ve been lookin’ since days (!) with PV3D 2.0 or rev91 ?

    Thx anyway for your work !

  5. 5 nuno said at 5:52 pm on March 13th, 2008:

    Ohm: make sure you’re using the right papervision3d revision. In the previous comment Sean already showed on to create a cube with pv3d 2.0.


Leave a Reply