packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/MeshLoader/Texturizer.cs
/// <summary>
/// Renders the mesh with the specified transformation. This alternate render method
/// supplements the base class rendering to provide part-by-part texturing support.
/// </summary>
/// <param name="modelTransform"></param>
Renders the mesh with the specified transformation. This alternate render method
supplements the base class rendering to provide part-by-part texturing support.
Renders the mesh with the specified transformation . This alternate render method supplements the base class rendering to provide part - by - part texturing support .
public void Render(Matrix3D modelTransform)
        {
            RasterizerDescription rasterizerDescription = new RasterizerDescription()
            {
                FillMode = FillMode.Solid,
                CullMode = CullMode.Back,
                FrontCounterclockwise = false,
                DepthBias = 0,
                DepthBiasClamp = 0,
                SlopeScaledDepthBias = 0,
                DepthClipEnable = true,
                ScissorEnable = false,
                MultisampleEnable = true,
                AntiAliasedLineEnable = true
            };
            try
            {
                solidRasterizerState = this.manager.device.CreateRasterizerState(rasterizerDescription);
                rasterizerDescription.FillMode = FillMode.Wireframe;
                wireframeRasterizerState = this.manager.device.CreateRasterizerState(rasterizerDescription);
                base.Render(modelTransform.ToMatrix4x4F());
            }
            finally
            {
                if (solidRasterizerState != null)
                {
                    solidRasterizerState.Dispose();
                    solidRasterizerState = null;
                }
                if (wireframeRasterizerState != null)
                {
                    wireframeRasterizerState.Dispose();
                    wireframeRasterizerState = null;
                }
                currentRasterizerState = null;
            }
        }
public void Render ( Matrix3D modelTransform ) { RasterizerDescription rasterizerDescription = new RasterizerDescription ( ) { FillMode = FillMode . Solid , CullMode = CullMode . Back , FrontCounterclockwise = false , DepthBias = 0 , DepthBiasClamp = 0 , SlopeScaledDepthBias = 0 , DepthClipEnable = true , ScissorEnable = false , MultisampleEnable = true , AntiAliasedLineEnable = true } ; try { solidRasterizerState = this . manager . device . CreateRasterizerState ( rasterizerDescription ) ; rasterizerDescription . FillMode = FillMode . Wireframe ; wireframeRasterizerState = this . manager . device . CreateRasterizerState ( rasterizerDescription ) ; base . Render ( modelTransform . ToMatrix4x4F ( ) ) ; } finally { if ( solidRasterizerState != null ) { solidRasterizerState . Dispose ( ) ; solidRasterizerState = null ; } if ( wireframeRasterizerState != null ) { wireframeRasterizerState . Dispose ( ) ; wireframeRasterizerState = null ; } currentRasterizerState = null ; } }
Renders the mesh with the specified transformation.
Renders the mesh with the specified transformation .
// setup rasterization
modelTransform
Matrix3D
None