The Mesh Viewer tool enables you
to easily modify meshes.
Mesh Viewer includes the menu item listed here.
- Open mesh file. Opens a dialog to select a file in the .x or .m file format to be loaded and viewed.
- Open pMesh file. Opens a dialog to select a file in the progressive mesh format to be loaded and viewed.
- Create shape. Opens a sub-dialog to create some basic shapes that are defined programmatically (text, polygon, box, cylinder, torus, teapot, sphere, cone).
- Save mesh as. Opens a dialog to save the selected mesh to a file. The file can be written as a text or binary file.
- Close selected. Closes and deletes the currently selected mesh.
- Close non-selected. Closes and deletes the meshes that are not currently selected.
- Wireframe. View all content in wireframe mode.
- Edges. View all content in solid-shaded mode with the edges drawn in black.
- Creases. Highlight the creases on the visible meshes. A crease is an edge with a vertex that has a different piece of data on it for multiple faces that refer to it, that is, a different normal for the vertex per face.
- Strips. Show the strips that are generated by this mesh in blue. The blue line goes from the center of each triangle to the next triangle in the triangle strip.
- Adjacency. Show the adjacency of the polygons in a mesh by drawing a line from the center of a polygon to the center of the adjacent polygon.
- Bounding box. Draw the bounding boxes for the visible meshes.
- Normals. Draw the normals of the vertices on the visible meshes in yellow.
- Texture coords. Show the texture coordinates for the viewed geometry as rays projecting from the vertices. Because a vertex in Microsoft?Direct3D?can have up to eight texture coordinates, users must specify which sets they would like to view. This viewing mode is especially useful when the texture coordinates are filled with tangents for use in pixel shaders for example.
- Textures. Display the textures on the visible geometry.
- Lighting. Show the geometry in the scene with lighting calculations still on.
- Culling. Perform back face culling on the visible geometry when disabled polygons facing away from the camera are not drawn.
- Hierarchy. Display the frame hierarchy of the meshes that are currently loaded. This is displayed in a separate floating window. To make the window disappear, on the View menu, clear the Hierarchy command.
- Play animation. Play the current animation for the currently loaded geometry if one exists.
- Pause animation. Stop the animation at the current frame when playing.
- Normal speed. Interpret the time value in the animation from an .x file as 4800 units per second. Otherwise, the interpreted value is 30 units per second.
- Optimize. Optimizes the currently selected mesh with the selected optimization method. See the Direct3D extensions (D3DX) reference pages to see the differences in methods.
- Weld vertices. Removes duplicate vertices and makes polygons that use these vertices use the nondeleted vertex.
- Split mesh. Splits the selected mesh into multiple meshes that are less than specified size in vertices and faces.
- Collapse meshes. Collapses the currently selected meshes into a single mesh.
- Reset matrices. Resets the matrices for the frames that are loaded to their initial position.
- Mesh properties. Shows the selected mesh's flexible vertex format (FVF) render states and whether it is a 32-bit mesh.
- Skinning method. Allows the user to select the skinning method while animating a skinned mesh. The choices are nonindexed, indexed, and software skinning.
- Face selection. Enters a mode for the user to select an individual face on the current mesh.
- Vertex selection. Enters a mode for the user to select an individual vertex on the current mesh.
- Convert selected to PM. Convert the selected mesh to a progressive mesh. The conversion uses the error parameters that are entered in a dialog box. For more information about these parameters refer to the D3DX documentation of progressive meshes.
- Snapshot to mesh. Convert the current progressive mesh object to a static mesh object using the current settings of the progressive mesh.
- Set number of faces. Set the current number of faces in the progressive mesh to a specific number.
- Set number of vertices. Set the current number of vertices in the progressive mesh to a specific number.
- Trim. Set the minimum and maximum number of faces for a progressive mesh. When the user has set the trim values to the desired minimum and maximum, the progressive mesh can be trimmed to the selected values, thereby reducing the dynamic range of the progressive mesh.
- N-patch selected. Draw the current object as an N-patch object. The scroll bar in this mode selects the amount of N-patch iterations for the current object.
- Snapshot to mesh. Convert the selected object to a static mesh based on the current N-patch settings to create a high-resolution static mesh.
Icons and Usage
- Selection modes. The first three icons are easy ways for the user to select the selection mode. They are Mesh Selection Mode (Arrow), Face Selection Mode (yellow outlined triangle), and Vertex Selection Mode (Red point highlighted triangle). These are the same modes that are available from the menus in MeshOps.
- Display modes. The next icons are easy ways to select the most common display modes for geometry. They are Shaded mode (nonoutlined tri-color cube), Wire frame mode (wire frame cube), and Edge mode (outlined tri-color cube). These are the same modes that are available from the menus in View.
- Topology display modes. The next icons display specific topological information about the geometry displayed. They are adjacency (A), Strips (S), Creases (C), and Normals (N). These are the same modes that are available from the menus in View.
- Info. The next icon is the button that will display information about the currently selected element.
- Animation controls. The last two icons are animation controls for playing and pausing the animation for the currently visible mesh.
The status bar in MView displays the current status of the visible geometry. The order from left to right of the displayed information is currently selected element (face or vertex only), Mesh mode (polygonor pMesh), display frames per second, display triangles per second, number of displayed triangles, and number of displayed vertices.
The scroll bar will appear in two of the three mesh modes, pMesh and N-patch mode. In pMesh mode, the scroll bar indicates the range of displayed triangles for the progressive mesh. You can slide the scroll bar up or down to change the number of triangles displayed. In N-patch mode, the scroll bar indicates how many N-patch levels are being used. As the scroll bar is moved up or down, the number of N-patch interactions performed are adjusted accordingly.
For more information about any of the functions used by MView, refer to the D3DX documentation included in the Microsoft DirectX® software development kit (SDK).