DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Expand DG Kernel ControlsDG Kernel Controls
Expand API ReferenceAPI Reference
Expand ViewsViews
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > Models > Entities > Attributes > Appearance > Material Go to DGKC docs Search Documentation


Materials

Surfaces of real objects have different color and reflective properties. Metal is shiny, unpolished wood is not. To model different types of surfaces, every entity has Material property.

Programmatically properties of the material can be modified using IMaterial_DG interface.

Flat color material.

A material keeps three colors in RGB format and one float number - shininess. The three colors are 

Ambient color - component of ambient light, which the surface reflects. Ambient light is the light, which scattered in the environment.

Diffuse color - component of diffuse light, which the surface reflects. Diffuse color comes from particular direction, most often from a light source but scattered in all directions equally. Diffuse light reflects with most intensity when it comes squarely down on the surface. 

Specular color is the color which comes from particular direction and is reflected in a preferred direction, thus creating spotlights.

Each color is represented by three numbers of float type in range 0.0 to 1.0 for Red, Green and Blue components. 

Shininess of the material represented by single float number in range 0.0 to 128.0. The higher the value is, the smaller and brighter are highlights on the surface.

LightingEnabled property of a material determines whether lighting of the scene will be taken into acount during rendering of the surface.

Textures

Instead of  flat color a material can use texture to model materials with a specific pattern of the surface like wood or metal. Texture can be any image.

A texture can be applied for the whole entity or per face.

See also: Texture Programming sample

Wire frame related properties

UseForWire is true, color of the material will be used for wires rendered in wireframe rendering mode.

WireFrameColor (black the default) property determines color of the wires rendered in wireframe rendering mode

UseGlobalWireColor is true, color of the wires is determined by the 'global' wire color maintained as the WireColor color (id = 4) property of the Component Context.