Microsoft DirectX 8.0 (Visual Basic) |
Converts point representative data stored in Microsoft® DirectX® (.x) files to face adjacency information that is more flexible for optimization and simplification operations.
object.ConvertPointRepsToAdjacency( _ PointRep As Any, _ FaceAdjacency As Any)
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
Point representatives are a method of describing mesh adjacency by fusing two vertices with the same x-, y-, and z- coordinates but with different normal coordinates, u- and v-coordinates, color data, an so on. In a perfectly smooth mesh (a mesh without creases, boundaries, or holes), point representatives are redundant. In that case, it is possible to compute adjacent triangles by using a hash table to locate edges that share vertex indices. In the case of creases and texture boundaries, the point representatives are required to give a unique vertex index to use in a hash table for a group of co-located vertices that make up a vertex in the mesh.
The following code fragment shows how to use a D3DXBuffer object to pass adjacency information.
Dim d3dxbAdjacency As D3DXBuffer Dim PointRep As Any ' This code fragment assumes that d3dxbAdjacency and PointRep have been properly ' initialized. Call D3DX8.ConvertPointRepsToAdjacency(ByVal PointRep.GetBufferPointer, ByVal d3dxbAdjacency.GetBufferPointer)