<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<span class="Apple-style-span" style="font-family: Tahoma, Verdana, Arial, sans-serif; color: rgb(68, 68, 68); ">Hi all,<div><br></div><div>I had a question regarding the usage of the SetPosition() function of vtkActors. &nbsp;I am trying to change the location of an actor (actually a vtkVolume) in my scene in response to the movement of marker being tracked by a camera.</div><div><br></div><div>Basically, my change location function looks something like this:</div><div><br></div><div><br></div><div><div>vtkSmartPointer&lt;vtkVolume&gt; volume;</div><div>vtkSmartPointer&lt;vtkWindowToImageFilter&gt; w2if;</div></div><div>vtkSmartPointer&lt;vtkRenderWindow&gt; renWin;</div><div><br></div><div><div>&nbsp;void volumeDat::changeLoc(double pos[3])<span class="ecxApple-tab-span" style="white-space: pre; ">                </span>//pos[3] is the 3D location of the marker</div><div>&nbsp;{</div><div><span class="ecxApple-tab-span" style="white-space: pre; ">        </span>&nbsp;</div><div>&nbsp;&nbsp; volume-&gt;SetPosition(floor(pos[0]),floor(pos[1]),floor(pos[2])) &nbsp;&nbsp;</div><div>&nbsp;&nbsp;//change the location of the volume based on the position of the marker</div><div><br></div><div>&nbsp;&nbsp;renWin-&gt;Render();</div><div><br></div><div>&nbsp;&nbsp;w2if-&gt;SetInput(renWin);</div><div>&nbsp;&nbsp;w2if-&gt;Update();</div><div><br></div><div>&nbsp;&nbsp;return;</div><div>&nbsp;}</div></div><div><br></div><div>This will work the first time I call it (ie for the first time it sees the marker), but then whenever it is called again with a different position, the location in the scene does not change.</div><div><br></div><div>I have done a bit of checking to see where the problem may be, and found that I am correctly setting the position of the volume, as calling volume-&gt;GetPosition() will return the values of pos[3] that were stored via volume-&gt;SetPosition(), but the location of the volume in the scene does not change.</div><div><br></div><div>If anyone knows more about the workings of SetPosition() with respect to this I would greatly appreciate it.</div><div><br></div><div>Thanks,</div><div>Colin</div></span>                                               <br /><hr />Look 'em in the eye: FREE Messenger video chat <a href='http://go.microsoft.com/?linkid=9734382' target='_new'>Chat Now!</a></body>
</html>