[vtkusers] creating color maps

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Sun Feb 15 19:26:29 EST 2004


Hi Murali,
   it seems vtkElevationFilter generates scalar values without changing the
geometry or topology, so the hawaii example is presumably still a 3D
surface, just viewed from 'far' overhead so the z displacement is not
noticeable.

If you are reading your dataset and creating the vtk data set yourself you
could simply use the x and y coordinates to define points and the z value
as the scalar value at each point.
If the data set is created by a vtkReader you could still build your own 2D
data set by traversing points (vtkDataSet:GetNumberOfPoints, GetPoint...
etc).
If the x,y coords are regular you could use vtkStructuredPoints, if not you
would have to traverse the cells and create new 2D cells (all lying on a
plane).
There may be a 'high-level' way  using vtk filters too? I'm not sure on
this.

 regards
     Dave Pont

PS: I developed a C++ class that will colour a surface in discrete colour
bands, as an alternative to the continuously varying colour from the
standard vtkLookupTable. This may be of interest to you as it would give
terrain contours. I would be keen for someone to test drive this as it
displays a bug that might be related to my hardware/OS or might be in
vtk.....  ;-)



                                                                                                               
                      "Muralidharan                                                                            
                      Dhanakoti"               To:       <vtkusers at vtk.org>                                    
                      <murali at uab.edu>         cc:                                                             
                      Sent by:                 Subject:  [vtkusers] creating color maps                        
                      vtkusers-admin at vt                                                                        
                      k.org                                                                                    
                                                                                                               
                                                                                                               
                      16/02/2004 11:25                                                                         
                                                                                                               
                                                                                                               




Hi all,

I had a query about creating 2D height maps of my terrian data, when I use
Elevation Filter to associate scalars with my terrain, my terrain gets
colored according to the Lookup table I have designed, but I'am not sure
how I can get a just a 2D version with different colors representing
different heights.
I have a z = sin(x)*cos(y) terrain (basically a quad mesh obtained by
measuring z at discrete x and y).

I want my rendering to be something similar to the hawaii.tcl output, this
program was found in the CDROM with the VTK book (the older version) they
were reading from a file called honolulu.vtk, but that file was not found
in the CDROM.

Any thoughts would greatly be appreciated,
Murali.







More information about the vtkusers mailing list