More Tests...

_cube = new Cube();
_cube.width = 1005;
_cube.height = 400;
_cube.depth = 400;
_cube.material = new ColorMaterial(0xFFFF00);
_cube.cubeMaterials.front = new ColorMaterial(0xFF0000);
_cube.cubeMaterials.back = new ColorMaterial(0x00FF00);

_view.scene.addChild(_cube);

This makes a cube with a Yellow ColorMaterial and adds 2
ColorMaterials to the front and back.

But - once the cube is added to the scene I can no longer change faces
vua cubeMaterial:

_cube = new Cube();
_cube.width = 1005;
_cube.height = 400;
_cube.depth = 400;
_cube.material = new ColorMaterial(0xFFFF00);
_cube.cubeMaterials.front = new ColorMaterial(0xFF0000);

_view.scene.addChild(_cube);

_cube.cubeMaterials.back = new ColorMaterial(0x00FF00);

The back face never changes to Green.

What am I doing wrong?

Any help would be great.




On May 10, 7:43 am, JKaris <[email protected]> wrote:
> In testing I have found I can change the whole cube's material (ie.
> change colour of ColorMaterial on a click) but can't change just a
> single side via CubeMaterialsData,
>
> Any ideas?
>
> Thanks.
>
> On May 10, 12:04 am, JKaris <[email protected]> wrote:
>
> > Hi,
>
> > I have created a cube and set each side of the cube using
> > CubeMaterialsData.
>
> > I have been trying a number of ways then to change one of the faces
> > after it has been added to the scene, for example after a mouse has
> > been clicked, but I am failing to figure this out.
>
> > Any help on how to do this would be much appreciated.
>
> > I am using Away3D 3.5
>
> > Thanks,
> > jkaris.

Reply via email to