<window>.pick

Perform a pick operation on the subwindow

 

<window>.pick(
    info = False    
    mode = viz.WORLD    
    pos = [-1,-1]    
    eye = viz.BOTH_EYE    
    all = False    

)

 

info = False

If the value is True, it causes the pick command to return a VizIntersect object.


mode = viz.WORLD

This flag specifies whether to perform the pick operation on the world or screen. This can be either viz.WORLD or viz.SCREEN


pos = [-1,-1]

Position on screen to perform pick, in normalized units. If this is not specified then the current mouse position will be used.


eye = viz.BOTH_EYE

The eye to perform the picking on. Can be viz.BOTH_EYE, viz.LEFT_EYE, viz.RIGHT_EYE. If stereo mode is enabled, the command will automatically adjust the mouse coordinates for the specified eye.


all = False

If True, this command will return all the intersections, not just the first one.


Remarks

If info is False, this command will return a node3d object that the mouse is pointing at, unless picking was disabled on the node3d object.

If info is True, this command will return a VizIntersect object.

The following is a list of fields of the viz.Intersect object:

Attribute

valid

True if the line intersected, False if it didn't.

point

The point the line intersected with the object.

normal

The normal vector of the intersect point.

object

The geometry object the line intersected with.

name

The name of the subobject that the line intersected with.

Return Value

<node3d> object or VizIntersect object, depending on specified mode

Example

object = viz.MainWindow.pick()
if object.valid():
    print 'The mouse is over a geometry object'

See also

<window>.pickRect
<window>.screenToWorld
<window>.worldToScreen