Picking
Picking is the calculation of the intersection of a line and a mesh. Mudbox uses
different solutions in the following cases:
- Screen space picking - This solution is used when one end point of the line is the
same as the camera position in the space. A buffer with the same size as the viewport
is used in this case. The scene is rendered to this buffer each time the camera position
or a mesh changes. The vertex/face index is encoded into the final pixel colour. When
the user points to a location on the screen Mudbox reads the color of the pixel at
the position and decodes the needed information. This makes screen space picking very
fast once the buffer is rendered. During sculpting the picking must operate on the
original unchanged mesh, so the buffer has to be re-rendered only when the stroke
is finished. When a plane mirror is used the mirrored line does not fulfill the condition
mentioned above, but in that case a cloned camera is used for the other side and the
buffer is rendered for that camera too.
- Static mesh picking - In this case the start and end point of the mesh can be any
3D point in the space but the mesh must be static as this method requires a slow preprocessing
pass of the mesh. In this case a balanced sphere based tree representing the mesh
is created to enable fast checking. This solution is used during map extraction because
a lot of picking is required and the mesh is static.
Selection and Picking Classes
These classes are primarily used for selecting points on a mesh, or objects in a
scene. The Picker class can be used for defining plug-ins that customize how objects are selected on
a vector.
- Picker - These objects are used as part of the map extraction process.
- ScreenSpacePicker - These objects are used to translate the user action of clicking in the view into
a picked.
- Selector - This base class represents any shape in 3d space. Used for selection.
- SurfacePoint - Describes a location somewhere on the surface of a Mesh.