回复: Re: 回复: [vtkusers] texture mapping

Dai Qiang dqreg at yahoo.com.cn
Wed Jun 22 23:32:34 EDT 2005


Hi Fabio,
 
vtkAppendPolyData will reserve the texture coordinates data as long as both of pd1 and pd2 have tex coordinates.
 
I created an Actor for the pd1 in my project, coz I wanted to interact with it through a vtkBoxWidget. If you are not going to do that, I don't think an Actor is necessary. Just put them together.
 
Qiang

fabio depascalis <fabio.depascalis at gmail.com> 写道:
Hello Dai, thanks for your answer

if I understand well, I should separate my polydata pd in two parts
- pd1: the part on which I want to place the texture
- pd2: the other part

then i should set up the tcoords

pd1->GetPointData()->SetTCoords(tc1); 
pd2->GetPointData()->SetTCoords(0); 

and use appendpolydata:

vtkAppendPolyData *apd=vtkAppendPolyData::New();
apd->AddInput(pd1);
apd->AddInput(pd2);

vtkPolyDataMapper *map3=vtkPolyDataMapper::New();
map3->SetInput(apd->GetOutput()); 

vtkActor *actor3 = vtkActorWBB::New();
actor3->SetMapper(map3);
actor3->SetTexture(texture);

But this method extend the texture on whole apd (also on the points
with tcoords=0)
May be, Do I have to create two actor for pd1 and pd2 and join them
with vtkAssembly?



thanks


		
---------------------------------
DO YOU YAHOO!?
  雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050623/8e79df10/attachment.htm>


More information about the vtkusers mailing list