<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Amy,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for your reply, but what I need is to create
a colormap texture using a lookup table. </FONT></DIV>
<DIV><FONT face=Arial size=2>This is my source code. It's a method of a class,
so the variables not declared are members of that class.</FONT></DIV>
<DIV><FONT face=Arial size=2>inputData is a bidimensional matrix with certain
float values between 35.0 and 37.0.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The problem is that the texture is not applied to
the vtkPlaneSource. If I specify a regular bitmap texture (loaded with
vtkImageReader2), it works fine. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cristian</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>void createColormapTexture(vtkStructuredPoints
*inputData)<BR>{<BR> // compute max and min<BR> float
range[2];<BR> inputData->GetScalarRange(range);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> // lookup
table<BR> vtkLookupTable *lut =
vtkLookupTable::New();<BR> lut->SetHueRange (0.66667,
0);<BR> lut->SetNumberOfTableValues(256);<BR> lut->SetSaturationRange(
1, 1);<BR> lut->SetValueRange( 1,
1);<BR> lut->SetTableRange( range[0],
range[1]);<BR> lut->SetVectorComponent(
0);<BR> lut->Build();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkImageMapToColors *colormap =
vtkImageMapToColors::New();<BR> colormap->SetInput(inputData);<BR> colormap->SetLookupTable(lut);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkTexture *atext =
vtkTexture::New();<BR> atext->SetInput(colormap->GetOutput());<BR> atext->InterpolateOff();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkPlaneSource *plane =
vtkPlaneSource::New();<BR> plane->SetPoint1(Xres,0,0);<BR> plane->SetPoint2(0,Yres,0);</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR> vtkPolyDataMapper *planeMapper =
vtkPolyDataMapper::New();<BR> planeMapper->SetInput(plane->GetOutput());</DIV>
<DIV> </DIV>
<DIV> vtkActor *planeActor =
vtkActor::New();<BR> planeActor->SetMapper(planeMapper);<BR> planeActor->SetTexture(atext);</DIV>
<DIV> </DIV>
<DIV> ren->AddActor(planeActor);</DIV>
<DIV> </DIV>
<DIV> //
Delete<BR> atext->Delete();<BR> plane->Delete();<BR> planeMapper->Delete();<BR> planeActor->Delete();<BR> lut->Delete();<BR> colormap->Delete();<BR>}<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=amy.henderson@kitware.com href="mailto:amy.henderson@kitware.com">Amy
Henderson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=clucia1@uic.edu
href="mailto:clucia1@uic.edu">Cristian Luciano</A> ; <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, April 21, 2004 1:24
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] colormap
texture</DIV>
<DIV><BR></DIV>Hi Cristian,<BR><BR>Create an instance of vtkTexture, and set
its input to be your vtkStructuredPoints data set. The data set you're
applying a texture map to must have texture coordinates defined. If that is
the case, then calling SetTexture on the actor of the data set you want to
apply the texture to should do what you want.<BR><BR>The online documentation
for vtkTexture can be found at the following URL.<BR><A
href="http://www.vtk.org/doc/nightly/html/classvtkTexture.html"
eudora="autourl">http://www.vtk.org/doc/nightly/html/classvtkTexture.html<BR><BR></A>-
Amy<BR><BR>At 02:17 PM 4/21/2004, Cristian Luciano wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial
size=2>Hi,<BR></FONT> <BR><FONT face=arial size=2>How can I create a
colormap texture from precomputed scalar values contained in a
vtkStructuredPoints?<BR>The vtkStructuredPoints is an mxn
matrix.<BR></FONT> <BR><FONT face=arial
size=2>Thanks.<BR></FONT> <BR><FONT face=arial
size=2>Cristian<BR></FONT> <BR><FONT face=arial
size=2>__________________________________________________________<BR></FONT> <BR><FONT
face=arial size=2>Cristian J. Luciano<BR>Research Computer
Scientist<BR></FONT> <BR><FONT face=arial size=2>Electronic
Visualization Laboratory<BR>Industrial Virtual Reality
Institute<BR> <BR>University of Illinois at Chicago<BR>842 W. Taylor
Street, 2039 ERF <BR>Chicago, IL, 60607<BR>ph: (312) 996-0579<BR>fax: (312)
413-0447<BR><<A
href="http://www.evl.uic.edu">http://www.evl.uic.edu</A>><BR>__________________________________________________________
<BR> <BR></FONT> <BR> </BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>