[vtkusers] need help about basic color mapping
Mark Wyszomierski
markww at gmail.com
Fri Nov 16 09:26:10 EST 2007
What are you having problems with though, if I remember correctly the
color map lookup table classes have a member function like
AddNewPoint(scalar, red, green, blue), just like you need it,
Mark
On Nov 15, 2007 10:52 AM, Toron J. <ji_wi at yahoo.com> wrote:
> Hi,
>
> I want to use color mapping to represent the temperature on a 3D surface.
> The surface mesh contains 900 vertices stored in an obj file. The
> temperature is related to the vertex ID like the following format in a txt
> file.
> .....
> 50 87.4
> 51 85.2
> 52 74.9
> 53 78.3
> 54 80.6
> .....
>
> My code for drawing the surface (textured) is below,
> //*******************************************************
> vtkOBJReader *reader = vtkOBJReader::New();
> reader->SetFileName("surf.obj");
>
> vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
> normals->SetInput(reader->GetOutput());
>
> vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
> mapper->SetInput(normals->GetOutput());
>
> vtkBMPReader *texReader = vtkBMPReader::New();
> texReader->SetFileName("textu.bmp");
>
> vtkTexture *texture = vtkTexture::New();
> texture->SetInput(texReader->GetOutput());
>
> vtkActor *actor = vtkActor::New();
> actor->SetTexture(texture);
> actor->SetMapper(mapper);
>
> vtkRenderer *renderer = vtkRenderer::New();
> renderer->AddActor(actor);
>
> vtkRenderWindow *renwindow = vtkRenderWindow::New();
> renwindow->AddRenderer(renderer);
> renwindow->SetSize(500, 500);
> //**************************************************
>
> I do not know how to convert the temperature data to color map on this
> surface. I have read rainbow.tcl but still do not understand it. Does
> anyone can point out the procedure or show me any similar example? Thanks a
> lot!
>
> Toron
>
>
> ________________________________
> Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it
> now.
>
>
> _______________________________________________
> 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