Sure am confused - change texture

Software: Away3D 4.x

drbii, Member
Posted: 08 June 2014 02:53 AM   Total Posts: 72

I have an awd loaded.  It has materials and textures in it.  I want a texture to change when the user clicks a button.  I can’t get
mesh.material = newMaterial to work.  In my code the ” .material” is undefined.  I just don’t understand.

I know how to get the mesh from the asset library, but how do you get the material name???

Thanks.  I have really confused myself.

   

Avatar
theMightyAtom, Sr. Member
Posted: 09 June 2014 06:10 PM   Total Posts: 669   [ # 1 ]

Creating a new material and applying it to the Mesh should work just as well. What happens when you apply a new material to the mesh?

Cheers!

   

drbii, Member
Posted: 09 June 2014 06:53 PM   Total Posts: 72   [ # 2 ]

Hi theMightyAtom,
I got it to work, sort of…
I am using:
vertMat.texture = Cast.bitmapTexture(assetBone);

but it changes the texture for the whole object.  Can you change just for a sub mesh? 

Also .texture is all I could get to work…  Most examples and from what you are saying .material should work?  In my flash builder project .material return an undefined property.  Is there an away3d lib I have to load?  I’ve searched and have all the material libraries loaded (at least I think I do).

Thanks for your help.  I am trying to tackle this and vertex animation as well…ugh.

Little steps at a time wink
Dan

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X