[vtkusers] HELP! vtkTexture on vtkPolyData appears black after vtk upgrade to 5.2 from 4.0

Mike Suttie m.suttie at ucl.ac.uk
Mon Jun 8 07:10:18 EDT 2009


Hi there I have recently ported over from vtk 4.0 using VS6 to vtk5.2 on
vs2008.

Issues have been plentiful but this one I can't seem to understand. 

 

I have code that generates a (vtkPolyData) surface which has a texture
applied to it from a generated vtkImageData object BUT the surface texture
appears completely black. As far as I can see both the image data and the
surface are generated with no issues and are exactly the same as in the
previous environment.

 

The code I'm using for this is :

 

vtkPolyData *surface = vtkPolyData::New();

            vtkImageData *im = vtkImageData::New();

                  

 
((vtkTexturedSurfaceModel*)this->pca)->GetParameterisedTexturedSurface(b,sur
face,im);

             

            vtkTexture *texture = vtkTexture::New();

            texture->SetInput(im);

            texture->InterpolateOn();  

            im->Delete();     

                  

            vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();

                  mapper->SetInput(surface);

 

            vtkActor *actor = vtkActor::New();

                  actor->SetTexture(texture);

            actor->SetMapper(mapper);

 

                  actor->GetProperty()->SetAmbient(1);

 

 

I can't see anything wrong with this code and it works perfectly in the
previous environment. Can anyone think of anything that I should look into
for this issue?????

 

Many thanks in advance.

 

 

Mike 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090608/2eb392f4/attachment.htm>


More information about the vtkusers mailing list