[vtkusers] Changing colors?

Bill Lorensen wlorens1 at nycap.rr.com
Wed Sep 18 20:42:30 EDT 2002


By default, actors that have scalars associated with their PointData use the scalars to color the data. To turn off this "feature",

vhdContMapper ScalarVisibilityOff

At 02:41 PM 9/18/02 -0400, Jeremy Winston wrote:
>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
>_______________________________________________
>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://public.kitware.com/mailman/listinfo/vtkusers 





More information about the vtkusers mailing list