oackland
25-09-2012 16:40:57
Hello all,
In my project, I want to change the colour of an entity (the floor). Here is my code :
I also tried to obtain the material directly :
When I read again the Ambient and Diffuse properties are correctly changed but there is no effect visually speaking.
If you can help me,
thank you,
Oackland
In my project, I want to change the colour of an entity (the floor). Here is my code :
Public Sub CouleurCarrelage(ByVal NouvelleCouleur As Color)
Dim i As UShort = 0
Dim Mat As Material = mySceneManager.GetEntity("GroundEntity").GetSubEntity(i).GetMaterial
Mat.GetTechnique(i).GetPass(i).SetAmbient(1, 0, 0)
Mat.GetTechnique(i).GetPass(i).SetDiffuse(1, 0, 0, 1)
mySceneManager.GetEntity("GroundEntity").SetMaterialName(Mat.Name)
Mat.Dispose()
End Sub
I also tried to obtain the material directly :
Dim Mat As MaterialPtr = MaterialManager.Singleton.GetByName("Carrelage")
When I read again the Ambient and Diffuse properties are correctly changed but there is no effect visually speaking.
If you can help me,
thank you,
Oackland