<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. 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<vtkVolume> volume;</div><div>vtkSmartPointer<vtkWindowToImageFilter> w2if;</div></div><div>vtkSmartPointer<vtkRenderWindow> renWin;</div><div><br></div><div><div> 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> {</div><div><span class="ecxApple-tab-span" style="white-space: pre; ">        </span> </div><div> volume->SetPosition(floor(pos[0]),floor(pos[1]),floor(pos[2])) </div><div> //change the location of the volume based on the position of the marker</div><div><br></div><div> renWin->Render();</div><div><br></div><div> w2if->SetInput(renWin);</div><div> w2if->Update();</div><div><br></div><div> return;</div><div> }</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->GetPosition() will return the values of pos[3] that were stored via volume->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>