[vtkusers] Texture Mapping--Helppppppppppp

Rachel aracha2010 at gmail.com
Wed Jan 5 11:51:13 EST 2011


I need help i tried to implement texture mapping and when i execute the
program nothing is displayed:
Any help !
//points is the set of points
	vtkSmartPointer<vtkPolyData> data =vtkSmartPointer<vtkPolyData>::New();
		data->SetPoints(Points);
//i already computed texture coordinates 
		data->GetPointData()->SetTCoords(textureCoordinates);

		//read image
		vtkSmartPointer<vtkJPEGReader> readerJPEG
=vtkSmartPointer<vtkJPEGReader>::New();
		readerJPEG->SetFileName("xxxx.jpg");
		readerJPEG->Update();
		 // Apply the texture
		  vtkSmartPointer<vtkTexture> texture =vtkSmartPointer<vtkTexture>::New();
		  texture->SetInput(readerJPEG->GetOutput());
	
	      vtkSmartPointer<vtkPolyDataMapper> mapper =
		vtkSmartPointer<vtkPolyDataMapper>::New();
		mapper->SetInput(data);

		vtkSmartPointer<vtkActor> actor =vtkSmartPointer<vtkActor>::New();
		actor->SetMapper(data);
		actor->SetTexture(texture);
		renderer->AddActor(actor );
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Texture-Mapping-tp3327802p3329110.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list