GINO Graphics Suite - GINO v9.0  

gSetMaterialIndex

Syntax

[C/C++:]
void gSetMaterialIndex(int fmat, int bmat);
[F90:]
subroutine gSetMaterialIndex(fmat, bmat)
integer, intent(in) :: fmat, bmat

Arguments

fmat
Front face material index

< 0, No change
= GOFF, No front face material (see below)
= 1-256, Set front face material coefficients from material table

bmat
Back face material index

< 0, No change
= GOFF, No back face material (see below)
= 1-256, Set back face material coefficients from material table

Description

The routine gSetMaterialIndex() sets the current facet material coefficients from the material table for both the front and back faces of facets. These are multiplied by the current material colour settings (as set by gSetMaterialColour()) to give the actual material settings of either face.

Entries in the material table are set through the routine gDefineMaterial() and by default are as follows:.

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


When the back face material index is set to GOFF, no lighting calculations are performed on back facing faces. When both the front and back face material indices are set to GOFF, facet colours are switched to be set by the current line drawing colour (gSetLineColour()) and all material information is ignored.

Setting the facet material properties using gSetFacetMaterialProps() overrides any values set by this routine and gSetMaterialColour().

See Also

gSetMaterialIndex Usage
gDefineMaterial
gSetLineColour
gSetFacetMaterialProps
gSetMaterialColour