AColor : Color from Quantity )
is static;
---Level: Public
- ---Purpose: Modifies the ambient colour of the surface.
+ ---Purpose: Modifies the ambient and diffuse colour of the surface.
-- Category: Methods to modify the class definition
SetAmbientColor ( me : in out;
is static;
---C++: return const&
---Level: Public
- ---Purpose: Returns the ambient colour of the surface.
+ ---Purpose: Returns the diffuse colour of the surface.
---Category: Inquire methods
AmbientColor ( me )
// purpose :
// =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
-: myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
+: myDiffuseColor (0.2, 0.2, 0.2, Quantity_TOC_RGB),
+ myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
{
myRequestedMaterialName = Graphic3d_NOM_DEFAULT;
Init (myRequestedMaterialName);
// purpose :
// =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect (const Graphic3d_NameOfMaterial theName)
-: myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
+: myDiffuseColor (0.2, 0.2, 0.2, Quantity_TOC_RGB),
+ myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
{
myRequestedMaterialName = theName;
Init (myRequestedMaterialName);
myEmissiveCoef = 0.0f;
myEnvReflexion = 0.0f;
myShininess = 0.039f;
- myDiffuseColor .SetValues (0.0, 0.0, 0.0, Quantity_TOC_RGB);
+ myDiffuseColor .SetValues (0.2, 0.2, 0.2, Quantity_TOC_RGB);
mySpecularColor.SetValues (1.0, 1.0, 1.0, Quantity_TOC_RGB);
myMaterialName = theName;
// =======================================================================
const Quantity_Color& Graphic3d_MaterialAspect::Color() const
{
- return myAmbientColor;
+ // It is generally accepted to consider diffuse color as
+ // "general" color of a material when light shines on it
+ return myDiffuseColor;
}
// =======================================================================