[vtkusers] Color Mapping

DyXin DyXin dyxin_ at hotmail.com
Tue Jun 15 23:18:20 EDT 2004


It 's me again...

I wanna use color mapping but it doesn 't work and I don 't know what I 'm 
doing wrong...
I get a red figure instead of multiple colors...
Can someone help me pls?
Thnx a lot!

This is what I do:



vtkUnstructuredGrid dataSet
vtkPoints pts
vtkFloatArray scalars

.........

while { ![eof $file] } {
   # Read a line from the file and analyse it.
   scan $line "%f %f %f %f" v1 v2 v3 v4
   set line [gets $file]

   pts InsertNextPoint $v1 $v2 $v3
   # 0 < v4 < 250
   scalars InsertNextValue $v4
}

dataSet SetPoints pts
[dataSet GetPointData] SetScalars scalars

.........

vtkGaussianSplatter popSplatter
popSplatter SetInput dataSet
popSplatter SetSampleDimensions 50 50 50
popSplatter SetRadius 0.05
popSplatter ScalarWarpingOff

vtkContourFilter popSurface
popSurface SetInput [popSplatter GetOutput]
popSurface SetValue 0 0.01

vtkPolyDataMapper popMapper
popMapper SetInput [popSurface GetOutput]
popMapper ScalarVisibilityOn

vtkActor actor
actor SetMapper popMapper
[actor GetProperty] SetOpacity 0.3
[actor GetProperty] SetColor .9 .9 .9

.........

_________________________________________________________________
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl




More information about the vtkusers mailing list