[vtkusers] Colouring of contours

tom fogal tfogal at apollo.sr.unh.edu
Fri May 21 10:20:22 EDT 2004


oops.. forgot to cc the list.

------- Forwarded Message

From: tom fogal <tfogal at apollo.sr.unh.edu>
To: Ben Ringham <B.D.Ringham at lboro.ac.uk>
Subject: Re: [vtkusers] Colouring of contours 
In-Reply-To: Your message of "Fri, 21 May 2004 12:44:42 BST."
             <3F854B7C-AB1C-11D8-8FB1-000393567E98 at lboro.ac.uk> 
References: <3F854B7C-AB1C-11D8-8FB1-000393567E98 at lboro.ac.uk> 
Date: Fri, 21 May 2004 10:19:34 -0400
Sender: tfogal at apollo

Ben,
	Take a look at the 'vtkElevationFilter', its probably exactly
what you're looking for.
Just hook up its input to some other source's/filter's output, and set
the high and low point for the filter.

int a,b,x1,y1,z1,x2,y2,z2;
...
vtkSphereSource *s = vtkSphereSource::New();
vtkElevationFilter *e = vtkElevationFilter::New();
s->SetPhiResolution(a); s->SetThetaResolution(b);
e->SetInput(s->GetOutput();
e->SetLowPoint(x1,y1,z1);
e->SetHighPoint(x2,y2,z2);

obviously you probably have something more complicated than a sphere, but
you get the gist. It appears to internally set/choose colors.

HTH,

- -tom

 <3F854B7C-AB1C-11D8-8FB1-000393567E98 at lboro.ac.uk>Ben Ringham writes:
>Hi,
>
>I am currently developing a program to display a contour and would like 
>to add colour to this based on the height of the surface. To do this I 
>believe that I need to use one attribute for the data and one for the 
>colour. Is this correct? If so then how should I implement this?
>
>Thanks
>
>Ben Ringham
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cg
>i-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers

------- End of Forwarded Message




More information about the vtkusers mailing list