[vtkusers] issue with texturing an actor

-Daniel- ich_daniel at habmalnefrage.de
Thu May 18 12:06:27 EDT 2017


Hi everbody,

I want to represent an actor with a texture, but since the newer version it
does not work anymore.
In the version 7.0 ran everything fine. 
<http://vtk.1045678.n5.nabble.com/file/n5743317/texture_vtk7_0.jpg> 

But unfortunately not with version 7.1.1
<http://vtk.1045678.n5.nabble.com/file/n5743317/texture_vtk7_1_1.jpg> 

I tested it on Windows 7 32bit and on Windows 10 64bit.
I am using Java 1.8.


Does anyone have a hint for me?



Code snippet for testing:
...
  vtkJPEGReader jPEGReader = new vtkJPEGReader();
  jPEGReader.SetFileName ( imagename );
  jPEGReader.Update();
	
  vtkTexture texture = new vtkTexture();
  texture.SetInputConnection(jPEGReader.GetOutputPort());
	
  vtkOBJReader reader = new vtkOBJReader();
  reader.SetFileName(iname);
  reader.Update();
	
  vtkPolyData polyData2 = reader.GetOutput();
	
   // Renderer
  vtkPolyDataMapper mapper = new vtkPolyDataMapper();
  mapper.SetInputData(polyData2);
	
  vtkActor texActor= new vtkActor();
  texActor.SetMapper(mapper);
  texActor.SetTexture(texture);

  renderer.AddActor(texActor);
...





--
View this message in context: http://vtk.1045678.n5.nabble.com/issue-with-texturing-an-actor-tp5743317.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list