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.
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?
Hey,
What’s the exact error?
Usually a conversion error is self explainatory.
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);
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 !
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.