IDirect3DViewport::TransformVertices
HRESULT TransformVertices(DWORD dwVertexCount,
LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen);
Transforms a set of vertices by the transformation matrix.
·Returns D3D_OK if successful or an error otherwise, which may be one of the following values:
dwVertexCount
Number of vertices in the lpData parameter to be transformed.
lpData
Address of a D3DTRANSFORMDATA structure that contains the vertices to be transformed.
dwFlags
One of the following flags. See the comments section following the parameter description for a discussion of how to use these flags.
lpOffscreen
Address of a variable that is set to a nonzero value if the resulting vertices are all off-screen.
If the dwFlags parameter is set to D3DTRANSFORM_CLIPPED, this method uses the current transformation matrix to transform a set of vertices, checking the resulting vertices to see if they are within the viewing frustum. The homogeneous part of the D3DLVERTEX structure within lpData will be set if the vertex is clipped; otherwise only the screen coordinates will be set. The clip intersection of all the vertices transformed is returned in lpOffscreen. That is, if lpOffscreen is nonzero, all the vertices were off-screen and not straddling the viewport. The drExtent member of the D3DTRANSFORMDATA structure will also be set to the 2D bounding rectangle of the resulting vertices.
If the dwFlags parameter is set to D3DTRANSFORM_UNCLIPPED, this method uses the current transformation matrix to transform a set of vertices. In this case, the system assumes that all the resulting coordinates will be within the viewing frustum. The drExtent member of the D3DTRANSFORMDATA structure will be set to the bounding rectangle of the resulting vertices.
The dwClip member of D3DTRANSFORMDATA can help the transformation module determine whether the geometry will need clipping against the viewing volume. Before transforming a geometry, high-level software often can test whether bounding boxes or bounding spheres are wholly within the viewing volume, allowing clipping tests to be skipped, or wholly outside the viewing volume, allowing the geometry to be skipped entirely.