[vtkusers] Using multile texture files in vtkOBJImporter

vinmean iamdpak at gmail.com
Wed Aug 16 03:14:03 EDT 2017


Following is my function to import obj files with texture. But I need to
import obj files that have multiple .png files as textures. Is there a way
to use vtkOBJImporter class with mulitple texture files?

void import_vtk_tex_obj(std::string filenameOBJ, std::string filenameMTL,
std::string filenameTEX,
boost::shared_ptr<pcl::visualization::PCLVisualizer> view)
{
	vtkNew<vtkOBJImporter> importer;
	std::string texture_path =
vtksys::SystemTools::GetFilenamePath(filenameTEX);

	importer->SetFileName(filenameOBJ.data());
	importer->SetFileNameMTL(filenameMTL.data());
	importer->SetTexturePath(texture_path.data());
	importer->SetRenderWindow(view->getRenderWindow());
	importer->Update();
	vtkSmartPointer<vtkRenderer> renderer
=view->getRenderWindow()->GetRenderers()->GetFirstRenderer();
	renderer->ResetCamera();
}



--
View this message in context: http://vtk.1045678.n5.nabble.com/Using-multile-texture-files-in-vtkOBJImporter-tp5744430.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list