poIImagePlane LocateBy2Points

Aligns a 3D image plane with a model.

Syntax

Imageplane_handle LocateBy2PointspointList

Application

HyperView Tcl Modify

Description

An image plane in 3D mode can be aligned with a model to check correlation between a video and a simulation. This command aligns the image plane by defining a plane in model space, followed by two points in model space, and two corresponding points on the image or video. The image plane is then scaled and positioned appropriately to match the points specified.

Inputs

pointList
The alignment point list. The list consists of the X, Y, Z values of a vector defining a normal to the 3D plane on which the image plane will reside. This is followed by two X, Y, Z points in model space, and two corresponding X, Y points on the image.

Example

To create a 3D image plane, perform a 2 point alignment, and then query the image plane for alignment parameters:
Note: This example assumes that LS-Dyna Bumper demo model has been loaded.
hwi OpenStack
if {[catch {
    ::post::GetPostHandle client_handle
    hwi GetSessionHandle session_handle
    client_handle GetImagePlaneCtrlHandle ipc_handle
    set ipid1 [ipc_handle AddImagePlane Logo1]
    ipc_handle GetImagePlaneHandle imageplane_handle $ipid1
    imageplane_handle SetFileName g:/samples2/VideoOverlay/Altair_logo.jpg
    imageplane_handle SetMode 3D
    imageplane_handle SetCrop 0 0 0.9995 0.995
    imageplane_handle LocateBy2Points "-1.0 0.0 0.0 118.0 676.0 485.7 118.2 0.0 485.7 0 0 880 0"
    imageplane_handle SetFilterType ColorAlpha;
    imageplane_handle SetFilterMode equal;
    imageplane_handle SetColorAlphaTarget "255 255 255"
    imageplane_handle SetColorAlphaTolerance 18
    imageplane_handle SetMipMapMode Linear1
    puts "*****"
    puts "Alignment Mode = [imageplane_handle GetAlignmentMode]";
    puts "Alignment Data = [imageplane_handle GetAlignmentData]";
    puts "*****"
    client_handle Draw
} result]} {
    global errorInfo;
    puts stderr $result;
    puts "[session_handle GetError]";
    puts stderr "*** Tcl TRACE ***";
    puts stderr $errorInfo;
} else {
    puts "No errors.";
    puts "Warnings: ";
    puts "    [session_handle GetError]";
}

hwi CloseStac

Output:

*****
Alignment Mode = 2POINT
Alignment Data = -1.000000 0.000000 0.000000 118.000000 676.000000 485.700012 118.199997 0.000000 485.700012 0 0 880 0 
*****
No errors.
Warnings: 

Errors

Returns HW_InvalidHandle if the image plane handle is invalid, or PO_InvalidAlignmentParams if the parameters are invalid.