[vtkusers] Changing colors?

Jeremy Winston winston at cat.rpi.edu
Wed Sep 18 14:41:50 EDT 2002


VTKnowers,
    I was hoping to change the scalar values associated
with the points in the vtkPolyData output by vtkMarchingSquares, 
and to have those changed values affect the color of the actor
associated with that data.
    I'm doing something wrong.  No matter how I fiddle with the
scalars, the actor always appears the same shade of blue.

Here is a code snippet:

  vtkMarchingSquares vhdContour
    [...]
  vtkPolyDataMapper2D vhdContMapper
    vhdContMapper SetInput [vhdContour GetOutput]
  vtkActor2D vhdContActor
    vhdContActor SetMapper vhdContMapper

  vtkRenderer ren1
  vtkRenderWindow renWin
    renWin AddRenderer ren1

  ren1 AddActor2D vhdContActor

And I have been trying to get/set the scalars thusly:

  [[vhdContour GetOutput] GetPointData] GetComponent 0 0

  [[vhdContour GetOutput] GetPointData] SetComponent 0 0 12

Though the scalar values are being changed, the color remains the same.
Any hints will be greatly appreciated.

Thanks,
-Jeremy



More information about the vtkusers mailing list