InventorRayPicker

MLModule
genre Interaction
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLMiscModulesInv
definition MLMiscModulesInv.def
see also SoSelection2
keywords Interaction

Purpose

The module InventorRayPicker sends a SoRayPickAction through an Open Inventor scene and retrieves the first point where an object was hit.

Usage

Connect an Open Inventor scene to the input node, set the Width and Height of the (virtual) viewer region and the viewer coordinates of the point to be used to create the ray.

Press Pick to apply the pick action to the scene graph and retrieve the result.

Details

In order to be able to generate a 3D ray from the viewport dimensions and the click position, the connected sceneGraph has to contain the camera that is used to render the scene.

Windows

Default Panel

../../../Modules/ML/MLMiscModulesInv/mhelp/Images/Screenshots/InventorRayPicker._default.png

Input Fields

sceneGraph

name: sceneGraph, type: SoNode

Parameter Fields

Visible Fields

Define Ray Using

name: rayDefinitionMode, type: Enum, default: ViewportCoordinates

Defines how the ray’s coordinates are being interpreted.

Values:

Title Name
Viewport Coordinates ViewportCoordinates
Relative Viewport Coordinates RelativeViewportCoordinates
World Coordinates WorldCoordinates

Radius (for lines and points only)

name: pickRadius, type: Integer, default: 5, minimum: 0, maximum: 100

Set a radius around the picking ray to be able to pick lines and points. Does not apply for picking surfaces.

Width

name: viewportWidth, type: Integer, default: 100, minimum: 0

Sets the width of the viewport.

Height

name: viewportHeight, type: Integer, default: 100, minimum: 0

Sets the height of the viewport.

X-Pos. (viewportPositionX)

name: viewportPositionX, type: Integer, default: 0, minimum: 0

Sets the X-position of the ray in the defined viewport.

Y-Pos. (viewportPositionY)

name: viewportPositionY, type: Integer, default: 0, minimum: 0

Sets the Y-position of the ray in the defined viewport.

X-Pos. (relativeViewportPositionX)

name: relativeViewportPositionX, type: Float, default: 0.5, minimum: 0, maximum: 1

Sets the relative X-position of the ray.

Y-Pos. (relativeViewportPositionY)

name: relativeViewportPositionY, type: Float, default: 0.5, minimum: 0, maximum: 1

Sets the Y-position of the ray in the defined viewport.

Start

name: worldStartPosition, type: Vector3, default: 0 0 0

Sets the start position of the ray in world coordinates.

Direction

name: worldDirectionVector, type: Vector3, default: 0 0 0

Sets the direction vector of the ray in world coordinates.

Pick

name: pick, type: Trigger

If pressed, the SoPickAction is sent through the Open Inventor scene.

Pick Successful

name: pickSuccessful, type: Bool, persistent: no

Shows whether the picking was successful, i.e. it hit an object.

Object Position

name: objectPosition, type: Vector3, persistent: no

Shows the position of the hit object.

World Position

name: worldPosition, type: Vector3, persistent: no

Shows the world position of the hit point.

Object Type

name: objectType, type: String, persistent: no

Shows the type of the hit object.