How to Tint a mesh/material ?

Software: Away3D 4.x

oh_meeeeee, Newbie
Posted: 23 September 2012 09:45 PM   Total Posts: 7

Hello everyone,

Looks like a simple solution but I am kind of stuck here… I have a red texture mapped on a mesh, a wall.

I want to change it’s color to another color, tint it. I tried applying colorTransform to TextureMaterial like so:

planeMaterial.colorTransform = myColorTransform; 

but it override the complete texture and make it single color. Also tried playing with the alphaMultiplier… but didnt work.

Appreciate a solution smile

Thanks and cheers,
ak

   

John Wilson, Member
Posted: 24 September 2012 06:47 AM   Total Posts: 62   [ # 1 ]

You can change the material’s ambientColor - it works best with light coloured materials.

   

oh_meeeeee, Newbie
Posted: 24 September 2012 06:51 AM   Total Posts: 7   [ # 2 ]

Which means I add a light in the scene just for the mesh to be colored and make changes to light and material’s ambient color.. Am I correct?

I believe I also tried this but what happens is that it changes the color of shadows too. Shadows are being casted from other meshes on to this mesh.

Thanks,
ak

   

John Wilson, Member
Posted: 24 September 2012 07:37 AM   Total Posts: 62   [ # 3 ]

You don’t need to add a light specifically for the material you wish to tint as you are applying the ambientColor to the material, but I think there does have to be a light.  I haven’t tried it with shadows, I’m afraid.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X