Eyeshot 10 WinForms API Reference
ApplyMaterial(String,textureMappingType,Double,Double) Method
Example 

WinForms Assembly > devDept.Eyeshot.Entities Namespace > Mesh Class > ApplyMaterial Method : ApplyMaterial(String,textureMappingType,Double,Double) Method
Material name
Indicates the way Material texture is wrapped on the object
Material texture scale along the X axis
Material texture scale along the Y axis
Maps the specified material to this mesh. Before using this method you need to define a material and add it to the Materials collection.
Syntax
'Declaration
 
Public Overloads Sub ApplyMaterial( _
   ByVal matName As String, _
   ByVal mappingMode As textureMappingType, _
   ByVal scaleX As Double, _
   ByVal scaleY As Double _
) 
public void ApplyMaterial( 
   string matName,
   textureMappingType mappingMode,
   double scaleX,
   double scaleY
)

Parameters

matName
Material name
mappingMode
Indicates the way Material texture is wrapped on the object
scaleX
Material texture scale along the X axis
scaleY
Material texture scale along the Y axis
Remarks

The mesh nature is set to RichPlain or RichSmooth from this command.

You may need to call viewport.Entities.Regen() to see the effect of this command.

Example
The following code fragment demonstrates how to apply Cubic mapping to a Mesh object.
Mesh m = new Mesh(Mesh.natureType.RichSmooth);
 
m.MakeBox(10, 40, 20);
 
m.Translate(-10, 2, 20);
 
mainViewport.Materials.Add(new Material("Wood", Properties.Resources.Wood));
 
m.ApplyMaterial("Wood", textureMappingType.Cubic, 1, 1);
 
mainViewportLayout._entities.Add(m, 0, Color.Green);
Dim m As Mesh = New Mesh(Mesh.natureType.RichSmooth) 
m.MakeBox(10, 40, 20)
 
m.Translate(-10, 2, 20)
 
mainViewport.Materials.Add(New Material("Wood", Properties.Resources.Wood))
 
m.ApplyMaterial("Wood", textureMappingType.Cubic, 1, 1)
 
mainViewportLayout._entities.Add(m, 0, Color.Green)
See Also

Reference

Mesh Class
Mesh Members
Overload List