<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body link="#0000FF" vlink="#800080" lang="EN-AU">
<p>"Andrew J. P. Maclean" wrote:
<blockquote TYPE=CITE><style>
<!--
/* Font Definitions */
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<div class=Section1>
<div class="MsoNormal"><span style='font-size:10.0pt;
font-family:Arial'><font face="Arial"><font size=-1>After
performing a mouse interaction on a scene is it possible to get the transform
matrix that is being used to update the actors in the scene?</font></font></span></div>
</div>
</blockquote>
In tcl where I want a vtkCutter (<b><i>vTK_CUTF</i></b>) to face
the camera I do:-
<p><b>vtkMatrix4x4 vTK_Matrix</b>
<br>Reset_Matrix [camera GetViewTransformMatrix] <b><i>vTK_Matrix</i></b>
<br><b>vtkMatrixToHomogeneousTransform vTK_MHT</b>
<br>
vTK_MHT SetInput <i>vTK_Matrix</i>
<br><b>vtkTransformPolyDataFilter vTK_PFilter</b>
<br>
vTK_PFilter SetInput [<b><i>vTK_CUTF</i></b> GetOutput]
<br>
vTK_PFilter SetTransform [<i><b>vTK_MHT</b> </i>GetInverse]
<p>Where the called procedure is :
<p>proc <b>Reset_Matrix</b> { mat tempmat} {
<br> for {set i 0} {$i < 3}
{incr i} {
<br> for {set j 0} {$j < 3} {incr
j} {
<br>
eval "$tempmat SetElement $i $j [$mat GetElement $i $j]"
<br>
}
<br>
}
<br>
}
<p>It works but you have to fix your own translations (i.e cols and rows
4 in the proc.)
<p>Hope This Helps
<p>Dave Davies
</body>
</html>