Microsoft DirectX 8.1 (C++) |
Describes a rectangular high-order patch.
typedef struct _D3DRECTPATCH_INFO { UINT StartVertexOffsetWidth; UINT StartVertexOffsetHeight; UINT Width; UINT Height; UINT Stride; D3DBASISTYPE Basis; D3DORDERTYPE Order; } D3DRECTPATCH_INFO;
Value | Order Supported | Width and Height |
---|---|---|
D3DBASIS_BEZIER | Linear, Cubic and Quintic | Width = Height = (DWORD)order + 1 |
D3DBASIS_BSPLINE | Linear, Cubic and Quintic | Width = Height > (DWORD)order |
D3DBASIS_INTERPOLATE | Cubic | Width = Height > (DWORD)order |
To render a stream of individual rectangular patches (non-mosaic), you should interpret your geometry as a long narrow (1 × N) rectangular patch. The D3DRECTPATCH_INFO structure for such a strip (cubic bézier) would be set up in the following manner.
D3DRECTPATCH_INFO RectInfo; RectInfo.Width = 4; RectInfo.Height= 4; RectInfo.Stride= 4; RectInfo.Basis = D3DBASIS_BEZIER; RectInfo.Order = D3DORDER_CUBIC; RectInfo.StartVertexOffsetWidth = 0; RectInfo.StartVertexOffsetHeight = 4*i; // The variable i is the index of the patch you want to render.
The following diagram identifies the parameters that specify a rectangle patch.
Each of the vertices in the vertex buffer is shown as a black dot. In this case, the vertex buffer has 20 vertices in it, 16 of which are in the rectangle patch. The stride is the number of vertices in the width of the vertex buffer, in this case 5. The "x" offset to the first vertex is called the StartIndexVertexWidth and is 1 in this case. The "y" offset to the first patch vertex is called the StartIndexVertexHeight and is 0 in this case.
Header: Declared in D3d8types.h.