Hi Vincent,<br><br>Couple of things you might want to look into-<br><br>1) Validity time of the transform that is set to the MeshObject.<br>2) View Camera parameters<br><br>-Andinet<br><br><div><span class="gmail_quote">On 10/24/07, 
<b class="gmail_sendername">Vincent Gratsac</b> &lt;<a href="mailto:vincent.gratsac@irisa.fr">vincent.gratsac@irisa.fr</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;">
Hi igstk-users,<br><br>I&#39;m currently trying to apply a texture on a surface.<br>So I developed a new class called TexturedMeshObjectRepresentation which<br>inherits MeshObjectRepresentation.<br>This class does the same thing than its super class, but I added this
<br>code at the end of the CreateActors method :<br><br>&gt;&nbsp;&nbsp; if( m_TextureFileNameIsSet )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkPNMReader *pnmReader = vtkPNMReader::New();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pnmReader-&gt;SetFileName(m_TextureFileName.c_str());
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!&nbsp;&nbsp;pnmReader-&gt;CanReadFile(m_TextureFileName.c_str()))<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; igstkLogMacro( CRITICAL,&quot;Unable to read texture file\n&quot; );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkTexture* texture = vtkTexture::New();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; texture-&gt;SetInput( pnmReader-&gt;GetOutput() );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; texture-&gt;InterpolateOn();<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; meshActor-&gt;SetTexture(texture);<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp; this-&gt;AddActor( meshActor );<br><br>where m_TextureFileName contains the name of the corresponding PNM file.<br><br>The resulting surface representation is black.<br>I tried to write a simple VTK executable in order to test this code, and
<br>it works correctly...<br><br>So does anyone know where can be the problem ?<br><br>Thank you and have a nice day !<br><br>--<br>Vincent Gratsac<br>----------------------------------------------------<br>Unité/Projet VisAGeS U746
<br>INSERM/INRIA/CNRS/U. de Rennes I<br>IRISA<br>Campus de Beaulieu, 35042 Rennes Cedex, France<br><br>Ph:&nbsp;&nbsp;+33 (0) 2 23 23 49 20/ Fax: +33/0 2 99 84 71 71<br>email: <a href="mailto:Vincent.Gratsac@irisa.fr">Vincent.Gratsac@irisa.fr
</a><br><a href="http://www.irisa.fr/visages/">http://www.irisa.fr/visages/</a><br>-----------------------------------------------------<br><br>_______________________________________________<br>IGSTK-Users mailing list<br>
<a href="mailto:IGSTK-Users@public.kitware.com">IGSTK-Users@public.kitware.com</a><br><a href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
</a><br></blockquote></div><br>