GINO Graphics Suite - GINO v9.0  

gDefineMaterial

Syntax

[C/C++:]
void gDefineMaterial(int mat, GMATSTY *rep);
[F90:]
subroutine gDefineMaterial(mat, rep)

integer, intent(in) :: mat
type (GMATSTY), intent(in) :: rep

Arguments

mat
Material table index (1-256)

rep.ambient
Ambient reflection coefficient ( 0.0 -> 1.0)

rep.diffuse
Diffuse reflection coefficient ( 0.0 -> 1.0)

rep.specular
Specular reflection coefficient ( 0.0 -> 1.0)

rep.shine
Specular concentration (shininess) (%)

rep.trans
Translucence (filtering) - requires blending to be switched on ( 0.0 - 1.0)

Description

GINO keeps a table of material properties to be used in conjunction with material colours when setting the effect of lights on the surface of facets or objects. Up to 256 entries may be defined containing lighting coefficients and values. The current setting for the front and back faces of facets are set using the routine gSetMaterialIndex().

Initially, the first three entries of the table are set to the following values:

mat  ambient  diffuse  specular  shine  trans  Description
1    0.3      0.6      0.0       30.0   1.0    normal
2    0.3      0.6      1.0       30.0   1.0    plastic
3    0.3      0.6      1.0       100.0  1.0    shiny


The ambient, diffuse and specular coefficients are multiplied by the current colour values (as set by gSetMaterialColour()) to give the actual material properties of each face.

Translucence values less than 1.0 (opaque) are only utilized if surface blending is switched on by the gSetShadingMode() routine.

See Also

gDefineMaterial Usage
gSetMaterialColour
gSetMaterialIndex
gSetShadingMode