Tolga,<br><br>I believe VTK only supports a single texture per object.&nbsp; If you want to apply multiple textures you have a few choices.&nbsp; A simple way if your textures don&#39;t overlap, is to just make multiple copies of the object and texture each with a different texture.&nbsp; By placing a transparent border around your texture and setting the texturing parameters correctly, you can get a reasonable appearance.&nbsp; If this doesn&#39;t meet your needs, you have 2 other approaches.&nbsp; The first is to find a way to divide your object up into multiple objects each with its own texture, or you need to find a way to create a single texture map from your multiple individual images.&nbsp; For the former, look at:
<br><b><span style="font-size: 10pt; font-family: &quot;Times New Roman TUR&quot;;"><br></span></b><span style="font-size: 10pt; font-family: &quot;Times New Roman TUR&quot;;">W. Turner, T. Drake,
M. Osterkamp, D. Kaiser, J. Miller, P. Tu, C. Wilson, <i>Using computer vision
to map LASER ultrasound onto CAD geometries, </i>Review of Quantitative
Nondestructive Evaluation, 22, American Institute of Physics (2003)</span>

<br><br>and for the latter look at:<br><br><span><font size="-1">ROCCHINI, C., CIGNONI, P., AND MONTANI,
C. Multiple textures stitching and blending on 3d objects. In
Eurographics Rendering Workshop 1999 (June 1999), Eurographics.
<a href="http://citeseer.ist.psu.edu/rocchini99multiple.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://citeseer.ist.psu.edu/rocchini99multiple.html</a></font><br></span><br><br><div><span class="gmail_quote">
On 1/9/08, <b class="gmail_sendername">Tolga Birdal
</b> &lt;<a href="mailto:tbirdal@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tbirdal@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>I am currently trying to form a 3D object from OBJ files. What I would<br>like to do is to map multiple textures on the object. I know that the<br>texture coordinates are in vtkPolyDataMapper but I couldn&#39;t make use of
<br>it. vtkImageAppend simply didn&#39;t work well. There are different textures<br>for different places on the object.<br>Is this supported in VTK?<br><br>So far, I could only load a single texture using vtkTexture. Here is the
<br>code (The code is written in C# but exactly same with C++):<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkOBJReader vo = new vtkOBJReader();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vo.SetFileName(@&quot;C:\Objs\idle.obj&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vo.Update();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkPolyDataMapper stlMapper= new vtkPolyDataMapper();
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stlMapper.SetInput(vo.GetOutput());<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stlActor.SetMapper(stlMapper);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkJPEGReader bmp1 = ReadTexture(@&quot;C:\Objs\idle_hi.jpg&quot;);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//other textures to load
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//vtkJPEGReader bmp2 = ReadTexture(@&quot;C:\Objs\idle_L_hi.jpg&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//vtkJPEGReader bmp3 = ReadTexture(@&quot;C:\Objs\idle_R_hi.jpg&quot;);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkTexture vt = new vtkTexture();
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vt.InterpolateOn();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vt.AddInputConnection(bmp1.GetOutputPort());<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stlActor.SetTexture(vt);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkRenderer ren1 = new vtkRenderer();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ren1.AddActor

(stlActor);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkFormsWindowControl1.GetRenderWindow().AddRenderer(ren1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkFormsWindowControl1.GetRenderWindow().Render();<br><br><br>And here is the ReadTexture method:<br><br>private vtkJPEGReader ReadTexture(string fn)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkJPEGReader v = new vtkJPEGReader();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v.SetFileName(fn);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v.Update();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return v;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>Thanks for any help,<br>Tolga<br><br>_______________________________________________
<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ
</a><br>Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br><br clear="all"><br>
-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>R&amp;D Engineer<br>
28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120