[vtkusers] Textures on polydata.
Thomas Sundgaard Pedersen
sundgaard at inropa.com
Mon Feb 7 07:49:29 EST 2005
I am new to visualization, and was trying to add textures to some
stl-files, that I imported. It worked fine with a vtkPlaneSource as
input to the vtkPolyDataMapper, but didn't work with vtkSTLReader as
input. The actor is showen in the vtk window and represents the stl-file
as it should, but if I set the texture, I only get the whole actor
colored in the color of the bmp's first pixel, it seems?
This code shows how I implemented it:
vtkWin32OpenGLRenderWindow *renWin =
vtkRenderer *ren = vtkRenderer::New();
vtkSTLReader *STLReader = vtkSTLReader::New();
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
vtkActor *actor = vtkActor::New();
vtkBMPReader* bmpReader = vtkBMPReader::New();
vtkTexture* atext = vtkTexture::New();
160 x 160 pixles.
actor->SetTexture(atext); //Works fine with vtkPlaneSource, but not with
If I want to use textures on stl-files what do I do, or isn't it
possible at all?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers