<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Deepak Roy</b> <<a href="mailto:cdeepakroy@gmail.com">cdeepakroy@gmail.com</a>><br>Date: Jan 17, 2006 5:49 PM
<br>Subject: Re: Fwd: [vtkusers] Texture Mapping Problem....Please Help !!!!!<br>To: Ankur Deshmukh <<a href="mailto:adeshmuk@uccs.edu">adeshmuk@uccs.edu</a>><br><br></span>
<div>Hey Ankur,</div>
<div> </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> </div>
<div>I'll go ahead and describe what i did in my case. Hope it is of some help to you.</div>
<div> </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> </div>
<div>Once this is done, here is the pseudocode i followed: </div>
<div> </div>
<div>****************************************************************************************************************************</div>
<div><font size="2">
<p>vtkPolyData *pVtkMesh = FromVrmlFile( <vrml-model-file> );</p><font color="#008000" size="2">
<p>// create mesh polydata mapper</p>
<p></p></font><font size="2">vtkPolyDataMapper *pMeshMapper = vtkPolyDataMapper::New();
<p>pMeshMapper->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->CreateImageReader2(strTextureFile);</p>
<p>pTextureImageReader->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->SetInput( pTextureImageReader->GetOutput() );</p>
<p>pModelTexture->InterpolateOff();</p>
<p>pModelTexture->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->SetMapper( pMeshMapper );</p>
<p>pTorsoTextureActor->SetTexture( pModelTexture );</p>
<p>*************************************************************************************************************</p>
<p>Regards,</p>
<p>Deepak</p>
<p> </p>
<p> </p></font>
<p> </p></font></div>
<div><span class="e" id="q_108dac6559757553_1">
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 1/17/06, <b class="gmail_sendername">Ankur Deshmukh</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:adeshmuk@uccs.edu" target="_blank">adeshmuk@uccs.edu</a>
> 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>> Hello Marc,<br>><br>> Seems like a lot of mutually benefiting discussion. I like it.<br>><br>> Infact i was looking for a way to play with the clamping and
<br>> interpolation options of the texture in VTK. But i found no way to do<br>> this.<br>><br>> All vtkTexture provides us is Interpolate On/Off and Repeat On/Off.<br>><br>> Do you know how to change the way the texture interpolation is done.
<br>><br>> I hope this might solve my problem.<br>><br>> Eagerly waiting for your reply .....<br>><br>> Regards,<br>><br>> Deepak<br>><br>><br>><br>> On 1/17/06, *Marc Cotran* <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marc@cotran.ca" target="_blank">
marc@cotran.ca</a> <mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marc@cotran.ca" target="_blank">marc@cotran.ca</a>>> wrote:<br>><br>> Hi Deepak,<br>><br>> Quick question: does using Flat interpolation instead of Gouraud or
<br>> Phong get rid of the cracks? <br>><br>> It does for me...<br>><br>> Marc<br>><br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________
<br>>This is the private VTK discussion list.<br>>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>>Follow this link to subscribe/unsubscribe: <br>><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>><br>><br><br></blockquote></div><br></span></div>