[vtkusers] ComputeDisplayToWorld: Z direction ?

Jeff Lee jeff at cdnorthamerica.com
Mon Aug 18 10:18:30 EDT 2003


did you reset the camera clipping planes after the event?
-Jeff

Mathieu Malaterre wrote:

> Hi all,
>
>     I would like a mouse event that can move my vtkBoxWidget along the 
> Z (back to front) direction. I copy/paste the 
> vtkBoxWidget::OnMouseMove, and change few things:
>
> ...
>   // Compute the two points defining the motion vector
>   this->ComputeWorldToDisplay(this->LastPickPosition[0], 
> this->LastPickPosition[1], this->LastPickPosition[2], focalPoint);
>   z = focalPoint[2];
> this->ComputeDisplayToWorld(double(this->Interactor->GetLastEventPosition()[0]), 
>
> double(this->Interactor->GetLastEventPosition()[1]), z, prevPickPoint);
>
> this->ComputeDisplayToWorld(double(X), double(Y), (z + .1), pickPoint);
> //ComputeDisplayToWorld(double(X), double(Y), (z - .1), pickPoint);
> this->Translate(prevPickPoint, pickPoint);
> ...
>
> But my vtkBoxWidget is disappearing. Does anyone knows why there is a 
> refresh problem along the Z direction ?
> Or else could someone give me other clue to move a vtkBoxWidget along 
> the Z direction (in fact: back-to-front or front-to-back)
>
>
> In case someone was interested I put a patch here:
> http://www.creatis.insa-lyon.fr/~malaterre/vtk/box.patch
>
> ($ cvs -z3 diff -u Hybrid/vtkBoxWidget.* > box.patch)
>
> Thanks a lot,
> mathieu
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>





More information about the vtkusers mailing list