[vtkusers] vtkDataSetMapper Coloring Question
Jeremy Stout
stout.jeremy at gmail.com
Thu Jul 7 10:18:51 EDT 2005
Thanks for the tip, I was able to get it working.
Jeremy Stout
On 7/7/05, krs <krs at uncc.edu> wrote:
> You need to build your own color lookuptable - there are several
> examples under vtkColorLookupTable that shows you how to do this.
>
> -- krs
>
>
>
> ................................................................................................................
>
> Kalpathi Subramanian Ph: 704 687
> 8579
>
> Dept. of Computer Science Fax: 704 687 3516
>
> The Univ. of N. Carolina Email:
> krs at uncc.edu Charlotte, NC 28223
> Web: www.cs.uncc.edu/~krs
>
> On Jul 7, 2005, at 8:43 AM, Jeremy Stout wrote:
>
> I am using vtkDataSetMapper to help visualize a data set after putting
> it through a series of filters. As part of the visualization process,
> I am trying to color the dataset by a specific scalar array. That part
> is working pretty good for me. The only problem I am running into is
> that I want to flip the color spectrum on the lookup table the mapper
> is using so that blue represents the lower boundary of my scalar range
> and red is the upper range. At the moment, blue is representing the
> upper range and red the lower range. I've looked through the
> vtkLookupTable and vtkDataSetMapper APIs, but I haven't seen anything
> that will let me do what I am wanting. For what it is worth, here is
> the code I am using to setup the mapper (this is Java):
>
> vtkDataSet filteredDataSet;
>
> filteredDataSet = finalFilter.GetOutput();
> filteredDataSet.SetActiveScalars("void_fraction");
>
> dataSetMapper = new vtkDataSetMapper();
> dataSetMapper.SetInput(filteredDataSet);
> dataSetMapper.SetScalarModeToUsePointFieldData();
> dataSetMapper.SetScalarRange(0.0, 4800.0);
> dataSetMapper.SelectColorArray("void_fraction");
>
> I figure it is rather easy to swap the colors, but I am not seeing how
> to do it. Any help in this matter would be appreciated.
>
> Jeremy Stout
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
More information about the vtkusers
mailing list