[vtkusers] 3D-2D graphics problems

Elizabeth Bullitt bullitt at med.unc.edu
Mon Oct 9 03:48:14 EDT 2000

Would much appreciate help in finding a few functions that I think must
be somewhere, and also in getting something to work under vtk 3.1 that
did under 2.4 but that I'm having trouble with now. Many thanks in

    In general, am working with 3D-2D medical image registration, in
which a textured plane is placed on the origin and 3D objects are
rotated/translated such that their projections are thrown upon the plane
(which lies farther away from the camera than the 3D objects). Here is
the problem list:

    1. I sometimes need to define 2D lines on the plane itself. Under
vtk 2.4 I could create vtkActor2Ds and make polylines of any desired
color that appeared to be drawn on that plane. Under 3.1 I can make
polylines that appear in the correct locations, but the colors are
always black unless I take away the plane. If the plane is not there,
SetColor() works fine. If it is there, all I get is black polylines. If
I query the actor about what it thinks its color should be it gives me
the right answer--but it continues to draw itself black. Have tried
changing the LayerNumber, which seems to make no difference to anything
at all. Suggestion?

    2. The vtkVolumes have a nice feature of allowing one to set
variable opacities according to the intensity values of the dataset by
using a vtkPiecewiseFunction and calling SetScalarOpacity. I really like
this, and would like to apply it to my textured plane. However, I can't
find a way to get this to work.  How can I set variable opacity
according to intensity value for a textured plane?

    3. Placing a textured plane on the origin and rotating/translating
3D objects "in front of" it means that I have to take over the mouse
callbacks and apply SetUserMatrix to each of the perhaps hundreds of 3D
objects involved. I can't move the camera because otherwise its
relationship to the plane changes. It would be preferable to texture map
a vtkActor2D that always remains "in back of" the 3D objects. However, I
can't figure out how to texture map a vtkActor2D. Suggestion?

Many thanks

More information about the vtkusers mailing list