Change model color

Software: Away3D 4.x

parele, Jr. Member
Posted: 29 November 2012 11:55 AM   Total Posts: 43

I cant seem to find a solution, I just want to change the color or texture color of my model:

my_model.material.color =  0xffffff 
// the above wont work its just the example: 

i have tried now for 2 days, for the life of me i cant seem to get this to work
im using a sea3d lib to embed my mesh"my_model” i posted the file at http://www.parele.com/carhdtest.html

if you right click the page , view source .. you could some action script thanks

 

   

Avatar
Fabrice Closier, Administrator
Posted: 29 November 2012 12:48 PM   Total Posts: 1265   [ # 1 ]

If you set the material and there is no changes, make sure that the mesh subMeshes are not having the original mesh material set too.
Or instead of making a new material, simply change the material.texture.bitmapData and envoke material.texture.invalidateContent(); once done.

   

parele, Jr. Member
Posted: 29 November 2012 01:20 PM   Total Posts: 43   [ # 2 ]

I’m not to sure exactly what you meant , i did try playing with what you wrote above but errors…

when i trace my model

trace(myModel.texture); 

output: [model object] [texture materia]// im guessing i have a materialTexture on this model…

Anyways ::

var colors:BitmapData = new BitmapData(256256true,0xFF0000);

var 
bob:BitmapTexture = new BitmapTexture(colors);

//enterframe event 

myModel.material = new TextureMaterialBitmapTexture(bob)) 

simply im just trying to change the color of my model to another color
breakdown Example :::

bob 0xFF0000;

onEnterframe la la la 

myModel
.material bob

// im hoping this gives a clear idea

 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X