Main Content

material

Control reflectance properties of surfaces and patches

Syntax

material shiny
material dull
material metal
material([ka kd ks])
material([ka kd ks n])
material([ka kd ks n sc])
material default
material(obj,...)

Description

material sets the lighting characteristics of surface and patch objects.

material shiny sets the reflectance properties so that the object has a high specular reflectance relative to the diffuse and ambient light, and the color of the specular light depends only on the color of the light source.

material dull sets the reflectance properties so that the object reflects more diffuse light and has no specular highlights, but the color of the reflected light depends only on the light source.

material metal sets the reflectance properties so that the object has a very high specular reflectance, very low ambient and diffuse reflectance, and the color of the reflected light depends on both the color of the light source and the color of the object.

material([ka kd ks]) sets the ambient/diffuse/specular strength of the objects.

material([ka kd ks n]) sets the ambient/diffuse/specular strength and specular exponent of the objects.

material([ka kd ks n sc]) sets the ambient/diffuse/specular strength, specular exponent, and specular color reflectance of the objects.

material default sets the ambient/diffuse/specular strength, specular exponent, and specular color reflectance of the objects to their defaults.

material(obj,...) operates on the surface and patch objects specified in vector obj. If obj includes a graphics object that is not a surface or patch object, then material operates on any surface or patch objects that are descendants of the specified object.

Tips

The material command sets the AmbientStrength, DiffuseStrength, SpecularStrength, SpecularExponent, and SpecularColorReflectance properties of all surface and patch objects in the axes. There must be visible light objects in the axes for lighting to be enabled. Look at the materal.m file to see the actual values set (enter the command type material).

Version History

Introduced before R2006a

See Also