M3G - 3D Object Materials
Materials A light can cause different effects. A shiny silver ball reflects the light in a different way than a sheet of paper does. M3G models these material characteristics with the following attributes: Ambient reflection: The light that is reflected by an ambient light source. Diffuse reflection: The reflected light is scattered equally in all directions. Emissive light: An object can send out light to imitate glowing objects. Specular reflection: The light that reflects off objects with a shiny surface. You can set a color for each material attribute. The shiny silver ball's diffused color would be silver and its specular component white. To get the final object color, the material's color mixes with the light's color. If you point a blue light toward the silver ball, it would turn bluish. Listing 9 shows how to use materials: Listing 9. Setting a material // Create appearance and the material. _cubeAppearance = n