<br><br><div class="gmail_quote">On Mon, Sep 13, 2010 at 8:05 PM, Granseier, Michael (VISUS) <span dir="ltr">&lt;<a href="mailto:granseier@visus.com">granseier@visus.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear VTK Users,<br>
<br>
I&#39;m trying to mark a three-dimensional point in a volume using the vtkCursor3D class.<br>
My problem is, that the length of the crosshairs&#39; lines stay constant, even if the position of the point is farther away from the camera.<br>
I&#39;m using SetModelBounds to specify the length.<br>
<br>
The same problem occurs with a vtkSphereSource. The radius of the source stays the same, no matter how far away it is from the camera.<br>
<br>
Is it possible to scale the crosshairs&#39; lines or the sphere radius relative to the camera distance?<br>
So, that the marker-object becomes smaller, the further the specified point is away from the camera and larger, the closer it is?<br>
<br></blockquote><div><br>I presume you mean &quot;becomes larger the further ...&quot;<br><br>3D props maintain a fixed physical (world) size, unlike 2D props which maintain a fixed display size.<br><br>I&#39;d recommend using the vtkHandleWidget, in conjunction with a vtkPointHandleRepresentation3D. This representation contains a vtkCursor3D and scales it dynamically based on the camera distance, so that it appears to maintain the same normalized display size.<br>
<br>Use the widget with event processing disabled (SetProcessEventsOff()) and its pretty much what you need. Take a look at its tests in VTK for usage.<br><br>-------<br><br>Alternatively, to dynamically on your own prop you could
write a prop that derives from vtkProp3D and internally contains a
vtkCursor3D along with its associated polydatamapper and actor. 
Then override the method RenderOpaqueGeometry to set your own actor scale.... something to the effect of...<br>
<br>
int myProp::RenderOpaqueGeometry(vtkViewport *v) <br>
{<br>
  // Get camera params<br>
  // Use the coordinate conversion methods vtkRenderer to <br>
  // compute the right scale so that your cursor maintains the same<br>
  // extent in normalized display coordinates.<br>
  this-&gt;Cursor3DActor-&gt;SetScale( computedScale );<br>
  return this-&gt;Cursor3DActor-&gt;RenderOpaqueGeometry(v);<br>
}<br>
<br>
<br>
--<br>
karthik <br></div></div><br>