Material Settings for 3D Objects
This section explains how to configure material properties for 3D objects. Here, "material" does not refer to surface patterns or textures, but rather to characteristics related to how the object reflects light.
Sponsored Link
Material Parameters
Material and Light Reflection
In the real world, the appearance of an object varies depending on its material. For example, a flat board will look "dry" if it's made of paper, but will look "shiny" if it's made of plastic. There are several reasons for these differences, but arguably the most significant factor is how the object reflects light.
Types of Light Reflection
Light reflection can be broken down into several components.
Take a plastic board, for instance. The surface appears uniformly lit because light hits the plastic and diffusely reflects in many directions, some of which reach our eyes. Meanwhile, the sharp, bright spots (highlights) are caused by specular reflection -- light rays bouncing directly off the surface. As for the areas in shadow, they are often faintly illuminated by scattered light that has bounced through the surrounding air and reached the back side of the object.
3DCG expresses different materials by adjusting the balance of these types of reflections. These adjustable balances are called material parameters.
Let's go through each of the major material parameters.
Diffuse Reflection Parameter
The diffuse reflection parameter controls how much incoming light is diffusely reflected in various directions -- like how light scatters off a sheet of paper.
This parameter significantly affects the perceived "dryness" or "matteness" of a surface. If you want to render materials like cloth or paper, increase this value. For metal-like surfaces, keep it lower.

Applying to Models
To set the diffuse reflection parameter for a model, use the setModelDiffuse(...) function:
- Function Format -
Arguments:
- modelID: The ID of the model to modify.
- strength: The intensity of diffuse reflection (range: 0.0 to 1.0).
Applying to Polygons
To set the diffuse reflection parameter for a polygon, use the setPolygonDiffuse(...) function:
- Function Format -
Arguments:
- polygonID: The ID of the polygon to modify.
- strength: The intensity of diffuse reflection (range: 0.0 to 1.0).
Diffractive Reflection Parameter
The diffractive reflection parameter controls how much light is scattered in the air around the object and curves around to illuminate the back side. Without this effect, the back sides of objects appear pitch-black, like celestial bodies in space.
This parameter behaves similarly to the ambient reflection parameter discussed later, but differs in that diffractive reflection creates a gradient depending on the angle of the light source.
Applying to Models
To set the diffractive reflection parameter for a model, use the setModelDiffractive function:
- Function Format -
Arguments:
- modedID: The ID of the model to modify.
- strength: The intensity of diffractive reflection (range: 0.0 to 1.0).
Applying to Polygons
To set the diffractive reflection parameter for a polygon, use the setPolygonDiffractive(...) function:
- Function Format -
Arguments:
- polygonID: The ID of the polygon to modify.
- strength: The intensity of diffractive reflection (range: 0.0 to 1.0).
Ambient Reflection Parameter
The ambient reflection parameter adjusts the effect of ambient light -- that is, light coming uniformly from the surrounding environment. In reality, light doesn't always travel in straight lines directly from a light source. Some of it reflects off walls or other surfaces and then indirectly illuminates the object. This surrounding light is called ambient light.
This parameter is used similarly to the diffractive reflection parameter. However, ambient reflection differs in that it has no directional dependency, resulting in a uniform illumination across the entire object.

Applying to a Model
To apply the ambient reflection parameter to a model, use the setModelAmbient(...) function:
- Function Format -
Arguments:
- modedID: Specifies the ID of the model to configure.
- strength: Specifies the ambient reflection strength, in the range of 0.0 to 1.0.
Applying to a Polygon
To apply the ambient reflection parameter to a polygon, use the setPolygonAmbient(...) function:
- Function Format -
Arguments:
- polygonID: Specifies the ID of the polygon to configure.
- strength: Specifies the ambient reflection strength, in the range of 0.0 to 1.0.
Specular Reflection Parameter
The specular reflection parameter controls how much incoming light reflects directly off the surface without scattering. This simulates mirror-like highlights often seen on smooth surfaces such as plastic.
By adjusting this parameter, you can control how shiny or glossy a surface appears.

Applying to a Model
To apply the specular reflection parameter to a model, use the setModelSpecular(...) function:
- Function Format -
Arguments:
- modedID: Specifies the ID of the model to configure.
- strength: Specifies the specular reflection strength, in the range of 0.0 to 1.0.
- angle: Specifies the highlight spread angle in radians, typically between 0.0 and 1.5.
Applying to a Polygon
To apply the specular reflection parameter to a polygon, use the setPolygonSpecular(...) function:
- Function Format -
Arguments:
- polygonID: Specifies the ID of the polygon to configure.
- strength: Specifies the specular reflection strength, in the range of 0.0 to 1.0.
- angle: Specifies the highlight spread angle in radians, typically between 0.0 and 1.5.
Emissive Parameter
The emissive parameter controls how strongly an object appears to emit light uniformly from its surface. Its visual effect is similar to ambient reflection, but it remains completely unaffected by the brightness of any light sources.
Applying to a Model
To apply the emissive parameter to a model, use the setModelEmissive(...) function:
- Function Format -
Arguments:
- modelID: Specifies the ID of the model to configure.
- strength: Specifies the emissive strength, in the range of 0.0 to 1.0.
Applying to a Polygon
To apply the emissive parameter to a polygon, use the setPolygonEmissive(...) function:
- Function Format -
Arguments:
- polygonID: Specifies the ID of the polygon to configure.
- strength: Specifies the emissive strength, in the range of 0.0 to 1.0.
- 3D Computer Graphics
- Setting Up the Foundation
- Mouse Control and Animation
- Using the Framework
- Creating and Placing Light Sources (and Adjusting Their Properties)
- Creating and Placing Models / Standard Models
- Creating and Placing Polygons, and Various Types of Polygons
- Moving 3D Objects
- Rotating 3D Objects
- Scaling 3D Objects
- Flipping 3D Objects
- Setting Colors for 3D Objects
- Configuring the Shape of 3D Objects
- Fill Settings for 3D Objects
- Material Settings for 3D Objects
- Understanding Coordinate Systems: Concepts, Creation, and Placement
- Moving Coordinate Systems
- Walking Coordinate Systems
- Controlling the Origin Position of a Coordinate System
- Rotating Coordinate Systems
- Spinning a Coordinate System
- Euler Angle-Based Attitude Control of Coordinate Systems
- Camera Work
- Creating, Placing, and Performing Basic Operations on Vectors
- Coordinate Transformations
- Screen Projection
- Collision Detection