[vtkusers] Coloring a 2D Mapper

Dirk Schmedding dirk.schmedding at zn-ag.com
Mon Jun 16 12:56:34 EDT 2003


Hi!

I don't know how to color an object mapped to a 2D Actor.

What I want is to map a cylinder to an 2D image and color it  	analogous
to its z (position) value. So far, so easy...

To map the object is no problem, but now I want to color the mapped
object. As greater as the z (position) value of the object is, as
brighter or darker the color have to be. (or colorfuller or what ever
seems to be easier to realize)

I hope anybody can help me!
By the way, I am working with Visual C++ under Windows NT.

best regards
Dirk


The current pipeline looks like this:

--------------- -------------------    ---------------
|vtkTransform | |vtkCylinderSource|    |vtkTransform |
--------------- -------------------    ---------------
             |      |                        |
             v      v                        v
----------------------------    ----------------------------
|vtkTransformPolyDataFilter|--> |vtkTransformPolyDataFilter|
----------------------------    ----------------------------
   |                                          |
   v                                          v
-------------------    ----------    ---------------------
|vtkPolyDataMapper|    |vtkPlane|--> |vtkPolyDataMapper2D|
-------------------    ----------    ---------------------
   |                                           |
   v                                           v
----------                               ------------
|vtkActor|                               |vtkActor2D|
----------                               ------------
   |                                           |
   v                                           v
-------------------                  -------------------
|vtkRendererWidget|                  |vtkRendererWidget|
-------------------                  -------------------







More information about the vtkusers mailing list