- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# MeshGrid Class Reference

This reference page is linked to from the following overview topics: Scene Graph, Mesh and Topology, Mesh Division, Writing Plug-ins.

Search for all occurrences

## Detailed Description

The MeshGrid class is an interface for dividing the surface of a mesh to grids.

A grid is a collection of quad faces over the surface in a grid pattern with the size of 1x1, 2x2, 4x4, 8x8 ... This class is responsible to suply a list of grids on the surface with the following rules:

1. The grids should be disjoint, one face can only belong to one grid and no more. 2. These grids should cover the whole surface.

This interface is used by Mudbox when it is rendering meshes with high polygon counts using level of detail. This object is always created as the child of the mesh object, so the MeshGrid object can obtain a pointer to the mesh by calling TreeNode::Parent().

If you need to control the algorithm by which these grids are created, you can override this class in a plug-in, and replace Mudbox's version, which is in the plugin called "MeshGrid". To create your own:

1. Write a plug-in that defines your own class derived from MeshGrid.

2. Delete the existing MeshGrid plugin, and copy yours into the plug-in folder.

On OSX, this plugin is found in the Mudbox module, under Contents>MacOS>plugins. On the PC, it is found in the work dir folder, under "plugins"

Definition at line 1073 of file mesh.h.

`#include <mesh.h>`

Inheritance diagram for MeshGrid:
[legend]

List of all members.

## Public Member Functions
virtual unsigned int | MeshGridCount (void) const
| This function should return the number of grids.
virtual unsigned int | MeshGridLevel (unsigned int iMeshGridIndex) const
| This function returns the level of the specified grid.
virtual unsigned int | MeshGridFaceIndex (unsigned int iMeshGridIndex, unsigned int iX, unsigned int iY) const
| This function returns the index of faces which are forming a specific grid.
virtual unsigned int | MeshGridVertexIndex (unsigned int iMeshGridIndex, unsigned int iX, unsigned int iY) const
| Returns the index of vertices for a grid.
virtual unsigned int | MeshGridTCIndex (unsigned int iMeshGridIndex, unsigned int iX, unsigned int iY) const
| Returns the texture coordinate index of the vertices in the grid.
virtual unsigned int | MeshGridIndexByFaceIndex (unsigned int iFaceIndex) const
| This function returns the grid index which contains the specified face.

## Member Function Documentation

virtual unsigned int MeshGridCount | ( | void |  | ) | const `[virtual]`

Search for all occurrences

This function should return the number of grids.

virtual unsigned int MeshGridLevel | ( | unsigned int | iMeshGridIndex | ) | const `[virtual]`

Search for all occurrences

This function returns the level of the specified grid.

When the level of a grid is N then it's size is 2^N x 2^N

Parameters:

  [in] | iMeshGridIndex | The index of the grid

virtual unsigned int MeshGridFaceIndex | ( | unsigned int | iMeshGridIndex,
|  | unsigned int | iX,
|  | unsigned int | iY
| ) |  | const `[virtual]`

Search for all occurrences

This function returns the index of faces which are forming a specific grid.

Parameters:

  [in] | iMeshGridIndex | The index of the grid
  [in] | iX | Horizontal position of the face within the grid
  [in] | iY | Vertical position of the face within the grid

virtual unsigned int MeshGridVertexIndex | ( | unsigned int | iMeshGridIndex,
|  | unsigned int | iX,
|  | unsigned int | iY
| ) |  | const `[virtual]`

Search for all occurrences

Returns the index of vertices for a grid.

Parameters:

  [in] | iMeshGridIndex | The index of the grid
  [in] | iX | Horizontal position of the vertex inside the grid
  [in] | iY | Vertical position of the vertex inside the grid

virtual unsigned int MeshGridTCIndex | ( | unsigned int | iMeshGridIndex,
|  | unsigned int | iX,
|  | unsigned int | iY
| ) |  | const `[virtual]`

Search for all occurrences

Returns the texture coordinate index of the vertices in the grid.

Parameters:

  [in] | iMeshGridIndex | The index of the grid
  [in] | iX | Horizontal position of the vertex inside the grid
  [in] | iY | Vertical position of the vertex inside the grid

virtual unsigned int MeshGridIndexByFaceIndex | ( | unsigned int | iFaceIndex | ) | const `[virtual]`

Search for all occurrences

This function returns the grid index which contains the specified face.

Parameters:

  [in] | iFaceIndex | Index of the face

The documentation for this class was generated from the following file:

- Mudbox/mesh.h

MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid
MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid MeshGrid