Microsoft DirectX 8.1 (Visual Basic) |
Sets the coefficients of a user-defined clipping plane for the device.
object.SetClipPlane( _ Index As Long, _ Plane As D3DPLANE)
If the method fails, an error is raised and Err.Number may be set to D3DERR_INVALIDCALL. This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
The coefficients that this method sets take the form of the general plane equation. The values in the D3DPLANE type Plane—a, b, c, and d—fit into the general plane equation so that ax + by + cz + d = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if ax+ by + cz + dw >= 0. Points that exist behind the clipping plane are clipped from the scene.
When the fixed function pipeline is used the plane equations are assumed to be in world space. When the programmable pipeline is used the plane equations are assumed to be in the clipping space (the same space as output vertices).
This method does not enable the clipping plane equation being set. To enable a clipping plane, use the D3DRS_CLIPPLANEENABLE render state constant of the CONST_D3DRENDERSTATETYPE enumeration.