5mm
| Genre: | METKMisc |
|---|---|
| Authors: | Christian Tietjen |
| Short description: | Enables picking of objects in a 3D scene. Is already included in METKViewer3D. |
This module is already included in METKViewer3D, but it may also be used separately.
It enables picking of objects in a 3D scene. The main problem of the most scenes is the existence of transparent objects. Thus, in the most cases, you may want to pick objects located behind other transparent objects. Also, the desired object itself may be transparent, too. Another requirement is, that toggling between Open Inventor's "`viewing"' and "`picking"' modi should be unnecessary. For that purpose, the module METKPicking is provided. In use with the SoCustomExaminerViewer, this viewer can be set up to send the viewing events to the scene, too. METKPicking grabs these events and acquires the selected objects dependent on some parameters.
Only objects which are registered by the METK can be selected. The registration is needed to provide information about importance (transparency). It is a bit hard to find out the transparency of an object in Open Inventor during a rendering pass. The METK is also used to check the ignorePickable flag. This flag can easily be set by the METKCSO module. For setting this parameter by hand, have a look into the METKCSO documentation.
The selection coordinate is not always the assumed one, especially when a transparent object is selected and several consecutive triangles were hit.
| Output: | outPickedObject
(Inventor) |
Returns an Open Inventor pointer to the picked object. |
|---|---|---|
| Output: | outScene
(Inventor) |
Connection to the viewer containing the whole scene. This field is used to grab the mouse events and is an input field only. |
| scrapLight: | When the desired object is located behind some other transparent objects, the object must be visible with scrapLight percent. Or, in other words, scraplight defines the early ray termination known from volume rendering or ray tracing. |
| pickPixelTolerance: | To distinguish between rotating a scene and picking into a scene, pickPixelTolerance defines how many pixels the mouse press and mouse release events may differ. |
| importanceWeighting: | You can define LAY_DESCRIPTION / INF_IMPORTANCE, otherwise, the inverse of INF_TRANSPARENCY is used. More important objects are preferred when selecting, weighted by this parameter. |
| boundingBoxSizeWeighting: | The other weighting parameter is the size of the bounding box of an object. It is assumed that the user wants to select a smaller object when he take care about the placement of the mouse over a very small object laying behind a large one. |
| objName: | Returns the name of the selected object. |
| selection: | Returns the coordinate of the selection. |
METKViewer3D, METKCSO