Microsoft DirectX 8.1 (Visual Basic) |
As Microsoft® Direct3D® renders primitives, it culls primitives that are facing away from the user.
Microsoft Visual Basic® applications set the culling mode by using the D3DRS_CULLMODE render state, which can be set to a member of the CONST_D3DCULL enumeration. By default, Direct3D culls back faces with counterclockwise vertices.
The following code sample illustrates the process of setting the culling mode to cull back faces with clockwise vertices.
' This code example assumes that d3dDevice contains a valid ' reference to a Direct3DDevice8 object. ' Set the culling state. Call d3dDevice.SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW)