dzzd
Interface IMaterial

All Superinterfaces:
IProgress, ISceneObject

public interface IMaterial
extends ISceneObject

Used for accessing to a Material.

Material specify the appareance of a Face3D.


Available implemented features are :
- ambiant color - diffuse color - specular color - specular power - specular level - diffuse color and/or alpha texture. - diffuse light detail texture. - global alpha.

Since:
1.0
Version:
1.0, 01/01/04
Author:
Bruno Augier
See Also:
IMaterial, ITexture

Method Summary
 int getAlpha()
          Gets alpha value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.
 int getAmbientColor()
          Gets ambient color as an 24bit int using the following bitmask RRGGBB.
 int getDiffuseColor()
          Gets diffuse color as an 24bit int using the following bitmask RRGGBB.
 ITexture getDiffuseTexture()
          Gets Texture to use for diffuse color texture.
 ITexture getDiffuseTextureDetail()
          Gets Texture to use for diffuse light detail texture.
 int getDiffuseTextureDetailFactor()
          Gets detail texture factor.
 IMappingUV getMappingUV()
          Gets MappingUV to use for diffuse texture color and diffuse light detail texture.
 int getSpecularColor()
          Gets specular color as an 24bit int using the following bitmask RRGGBB.
 int getSpecularLevel()
          Gets specular level in unit : 255 <=> 100% .
 int getSpecularPower()
          Gets specular power.
 void setAlpha(int alpha)
          Sets alpha value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.
 void setAmbientColor(int color)
          Sets ambient color as an 24bit int using the following bitmask RRGGBB.
 void setDiffuseColor(int color)
          Sets diffuse color as an 24bit int using the following bitmask RRGGBB.
 void setDiffuseTexture(ITexture texture)
          Sets Texture to use for diffuse color texture.
 void setDiffuseTextureDetail(ITexture texture)
          Sets Texture to use for diffuse light detail texture.
 void setDiffuseTextureDetailFactor(int diffuseTextureDetailFactor)
          Sets detail texture factor.
 void setMappingUV(IMappingUV mapping)
          Sets MappingUV to use for diffuse texture color and diffuse light detail texture.
 void setSpecularColor(int color)
          Sets specualar color as an 24bit int using the following bitmask RRGGBB.
 void setSpecularLevel(int level)
          Sets specular level in unit : 255 <=> 100% .
 void setSpecularPower(int power)
          Sets specular power.
 
Methods inherited from interface dzzd.ISceneObject
getId, getName, getScene3D, setId, setName
 
Methods inherited from interface dzzd.IProgress
getCurrentState, getNextState, getProgress, isStateReached, setProgress
 

Method Detail

getMappingUV

public IMappingUV getMappingUV()
Gets MappingUV to use for diffuse texture color and diffuse light detail texture.

Returns:
current MappingUV or null if none

setMappingUV

public void setMappingUV(IMappingUV mapping)
Sets MappingUV to use for diffuse texture color and diffuse light detail texture.

Parameters:
mapping - new MappingUV or null to remove

getAmbientColor

public int getAmbientColor()
Gets ambient color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getDiffuseColor

public int getDiffuseColor()
Gets diffuse color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getSpecularColor

public int getSpecularColor()
Gets specular color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getSpecularLevel

public int getSpecularLevel()
Gets specular level in unit : 255 <=> 100% . You can use value greater than 255 to make an object looking very bright.

Returns:
color.

getSpecularPower

public int getSpecularPower()
Gets specular power. Higher value increment the glosiness.

Returns:
color.

getAlpha

public int getAlpha()
Gets alpha value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.

Returns:
color.

setAmbientColor

public void setAmbientColor(int color)
Sets ambient color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setDiffuseColor

public void setDiffuseColor(int color)
Sets diffuse color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setSpecularColor

public void setSpecularColor(int color)
Sets specualar color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setSpecularLevel

public void setSpecularLevel(int level)
Sets specular level in unit : 255 <=> 100% . You can use value greater than 255 to make an object looking very bright.

Parameters:
level - new level.

setSpecularPower

public void setSpecularPower(int power)
Sets specular power. Higher value increment the glosiness.

Parameters:
power - new power.

setAlpha

public void setAlpha(int alpha)
Sets alpha value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.

Parameters:
alpha - new alpha value.

getDiffuseTexture

public ITexture getDiffuseTexture()
Gets Texture to use for diffuse color texture.

Returns:
interface to access the Texture or null if none

getDiffuseTextureDetail

public ITexture getDiffuseTextureDetail()
Gets Texture to use for diffuse light detail texture.

Returns:
interface to access the Texture or null if none

setDiffuseTexture

public void setDiffuseTexture(ITexture texture)
Sets Texture to use for diffuse color texture.

Parameters:
texture - interface to access the Texture or null if none

setDiffuseTextureDetail

public void setDiffuseTextureDetail(ITexture texture)
Sets Texture to use for diffuse light detail texture.

Parameters:
texture - interface to access the Texture or null if none

setDiffuseTextureDetailFactor

public void setDiffuseTextureDetailFactor(int diffuseTextureDetailFactor)
Sets detail texture factor. When using a detail texture this factor will be used to scale mapping coordinate of the main texture.
negative value mean size decrease.
positive value mean size increase.
value must be given as ln2 factor:
- 2 mean detail texture is 4 times smaller than main texture.
- 1 mean detail texture is 2 times smaller than main texture.
0 mean same size
+ 1 mean detail texture is 2 times bigger than main texture.
+ 2 mean detail texture is 4 times bigger than main texture.

Values can range from -8(scale by 1/256) to +8(scale by 256)

Parameters:
diffuseTextureDetailFactor - new detail factor

getDiffuseTextureDetailFactor

public int getDiffuseTextureDetailFactor()
Gets detail texture factor. When using a detail texture this factor will be used to scale mapping coordinate of the main texture.
negative value mean size decrease.
positive value mean size increase.
value must be given as ln2 factor:
- 2 mean detail texture is 4 times smaller than main texture.
- 1 mean detail texture is 2 times smaller than main texture.
0 mean same size
+ 1 mean detail texture is 2 times bigger than main texture.
+ 2 mean detail texture is 4 times bigger than main texture.

Values can range from -8(scale by 1/256) to +8(scale by 256)

Returns:
detail factor