Hi Rob,

I have tried re-applying cubeMaterials but still it remains the original
material.  Do I have to clear it or something else?  Only way I can do it is
to re-create the cube and apply the cubeMaterial again.

Any idea when the materialLibrary solution will be implemented?

Thanks,
Jonathan

On Thu, May 20, 2010 at 7:20 AM, Rob Bateman <[email protected]> wrote:

> Hey JKaris
>
> unfortunately, CubeMaterialsData was always a bit buggy. There are plans to
> replace this with the much more flexible materialLibrary object (availabel
> on all objects), which is why this hasn't been updated. basically, you can
> only change materials by re-applying the cubeMaterials property. sorry for
> the inconvenience :)
>
> Rob
>
>
>
> On Mon, May 10, 2010 at 4:26 AM, JKaris <[email protected]>wrote:
>
>> 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.
>>
>
>
>
> --
> Rob Bateman
> Flash Development & Consultancy
>
> [email protected]
> www.infiniteturtles.co.uk
> www.away3d.com
>

Reply via email to