Naturally, in some cases you only want to simplify a mesh. For example, imagine a model for a rocket you've just fired. Unless you have really bad aim, more than likely this object will not return toward you. However, a more common case is where you need to progressively lower or raise the level of detail. I'm sure you can see where the name of the progressive mesh came from. Unlike the SimplificationMesh, the ProgressiveMesh class derives from the BaseMesh class and can be used directly to draw the mesh onscreen. The ProgressiveMesh class is created in much the same way that the SimplificationMesh is. Look at the constructor: public ProgressiveMesh ( Microsoft.DirectX.Direct3D.Mesh mesh , Microsoft.DirectX.GraphicsStream adjacency , Microsoft.DirectX.Direct3D.AttributeWeights vertexAttributeWeights , Microsoft.DirectX.GraphicsStream vertexWeights , System.Int32 minValue , Microsoft.DirectX.Direct3D.MeshFlags options ) Notice that here, the constructor is almost a mixture of the constructor for the SimplificationMesh object and the Simplify method. The minValue parameter is the minimum amount you want to allow this mesh to be reduced to. After the object is created, you can set the number of faces or vertices to any number of faces or vertices between that minimum value and the ProgressiveMesh.MaxFaces or ProgressiveMesh.MaxVertices, depending on what you're modifying. Construction Cue
After your progressive mesh is created, you can use it just as you would use your normal mesh, drawing it every frame. You can add and remove vertices and faces depending on how far away from the camera the object is, so you have complete control over the level of detail of your object. Construction Cue
|