[vtkusers] ComputeDisplayToWorld: Z direction ?

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Mon Aug 18 09:44:43 EDT 2003


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




More information about the vtkusers mailing list