<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Deepak Roy</b> &lt;<a href="mailto:cdeepakroy@gmail.com">cdeepakroy@gmail.com</a>&gt;<br>Date: Jan 17, 2006 5:49 PM
<br>Subject: Re: Fwd: [vtkusers] Texture Mapping Problem....Please Help !!!!!<br>To: Ankur Deshmukh &lt;<a href="mailto:adeshmuk@uccs.edu">adeshmuk@uccs.edu</a>&gt;<br><br></span>
<div>Hey Ankur,</div>
<div>&nbsp;</div>
<div>I am not sure, on to what geometry your are trying to map your texture. And also whether you are repeating the texture all over your medical dataset.</div>
<div>&nbsp;</div>
<div>I'll go ahead and describe what i did in my case. Hope it is of some help to you.</div>
<div>&nbsp;</div>
<div>My geomtery is a Triangular mesh - an open surface representation of a Human Body. It is initially in the form of a VRML file and i have written custom vtkPolyDataSource Filter that gives me a vtkPolyData of the surface geometry i have. 
</div>
<div>&nbsp;</div>
<div>Once this is done, here is the pseudocode i followed: </div>
<div>&nbsp;</div>
<div>****************************************************************************************************************************</div>
<div><font size="2">
<p>vtkPolyData *pVtkMesh = FromVrmlFile( &lt;vrml-model-file&gt; );</p><font color="#008000" size="2">
<p>// create mesh polydata mapper</p>
<p></p></font><font size="2">vtkPolyDataMapper *pMeshMapper = vtkPolyDataMapper::New(); 
<p>pMeshMapper-&gt;SetInput( pVtkMesh );</p>
<p></p></font><font color="#008000" size="2">// read texture image from file 
<p></p></font><font size="2">vtkImageReader2Factory *pImageReaderFactory = vtkImageReader2Factory::New(); 
<p>vtkImageReader2 *pTextureImageReader = vtkImageReader2::New();</p>
<p>pTextureImageReader = pImageReaderFactory-&gt;CreateImageReader2(strTextureFile);</p>
<p>pTextureImageReader-&gt;SetFileName(strTextureFile);</p>
<p></p></font><font color="#008000" size="2">// build texture 
<p></p></font><font size="2">vtkTexture *pModelTexture = vtkTexture::New(); 
<p>pModelTexture-&gt;SetInput( pTextureImageReader-&gt;GetOutput() );</p>
<p>pModelTexture-&gt;InterpolateOff();</p>
<p>pModelTexture-&gt;RepeatOff();</p>
<p></p></font><font color="#008000" size="2">// create and setup actor 
<p></p></font><font size="2">vtkActor * pTorsoTextureActor = vtkActor::New(); 
<p>pTorsoTextureActor-&gt;SetMapper( pMeshMapper );</p>
<p>pTorsoTextureActor-&gt;SetTexture( pModelTexture );</p>
<p>*************************************************************************************************************</p>
<p>Regards,</p>
<p>Deepak</p>
<p>&nbsp;</p>
<p>&nbsp;</p></font>
<p>&nbsp;</p></font></div>
<div><span class="e" id="q_108dac6559757553_1">
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 1/17/06, <b class="gmail_sendername">Ankur Deshmukh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:adeshmuk@uccs.edu" target="_blank">adeshmuk@uccs.edu</a>
 &gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hey Deepak,<br><br>I am having problems with mapping my texture to a medical data set. I<br>was wondering if you could send me your code on how you have achieved 
<br>the texture mapping.<br><br>Thanks<br>Ankur<br><br>Deepak Roy wrote:<br><br>&gt; Hello Marc,<br>&gt;<br>&gt; Seems like a lot of mutually benefiting discussion. I like it.<br>&gt;<br>&gt; Infact i was looking for a way to play with the clamping and 
<br>&gt; interpolation options of the texture in VTK. But i found no way to do<br>&gt; this.<br>&gt;<br>&gt; All vtkTexture provides us is Interpolate On/Off and Repeat On/Off.<br>&gt;<br>&gt; Do you know how to change the way the texture interpolation is done. 
<br>&gt;<br>&gt; I hope this might solve my problem.<br>&gt;<br>&gt; Eagerly waiting for your reply .....<br>&gt;<br>&gt; Regards,<br>&gt;<br>&gt; Deepak<br>&gt;<br>&gt;<br>&gt;<br>&gt; On 1/17/06, *Marc Cotran* &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marc@cotran.ca" target="_blank">
 marc@cotran.ca</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marc@cotran.ca" target="_blank">marc@cotran.ca</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi Deepak,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Quick question: does using Flat interpolation instead of Gouraud or 
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Phong get rid of the cracks? <br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; It does for me...<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Marc<br>&gt;<br>&gt;<br>&gt;------------------------------------------------------------------------<br>&gt;<br>&gt;_______________________________________________ 
<br>&gt;This is the private VTK discussion list.<br>&gt;Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ 
</a><br>&gt;Follow this link to subscribe/unsubscribe: <br>&gt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers 
</a><br>&gt;<br>&gt;<br><br></blockquote></div><br></span></div>