<div dir="ltr">What happens if you remove the TextureMapToPlane? PlaneSource generates texture coordinate by default. So connect that directly to the mapper and what happens?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 12, 2016 at 12:21 PM, Roberto Gori <span dir="ltr"><<a href="mailto:r.gori@cineca.it" target="_blank">r.gori@cineca.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000">
<div>Hi,</div>
<div> </div>
<div>sorry for cross-posting but no one is answering to my question on the 
vtkusers list.</div>
<div> </div>
<div><font face="Times New Roman">As you can see running this code the plane is 
visualized without texture.</font></div>
<div><font face="Times New Roman"></font> </div>
<div><font face="Times New Roman">I think the problem is in rendering a texture 
on a vtkFollower. </font></div>
<div><font face="Times New Roman">Can someone open a bug on 
Mantis?</font> </div>
<div><font face="Times New Roman"><font face="Calibri"></font> </font></div>
<div><br>#include <vtkImageData.h><br>#include 
<vtkJPEGReader.h><br>#include <vtkPolyDataMapper.h><br>#include 
<vtkPolyData.h><br>#include <vtkSmartPointer.h><br>#include 
<vtkTextureMapToPlane.h><br>#include <vtkPlaneSource.h><br>#include 
<vtkTexture.h><br>#include <vtkRenderer.h><br>#include 
<vtkRenderWindow.h><br>#include 
<vtkRenderWindowInteractor.h><br>#include 
<vtkFollower.h><br>#include <vtkVersion.h><br><br>int main ( int 
argc, char *argv[] )<br>{<br>// Parse command line arguments<br>if ( argc != 2 
)<br>{<br>std::cerr << "Usage: " << argv[0] << " Filename" 
<< std::endl;<br>return EXIT_FAILURE;<br>}<br><br>std::cout << "VTK 
version:" << vtkVersion::GetVTKVersion() << 
std::endl;<br><br>std::string inputFilename = argv[1];<br><br>// Read the image 
which will be the texture<br>vtkSmartPointer<vtkJPEGReader> jPEGReader 
=<br>vtkSmartPointer<vtkJPEGReader><wbr>::New();<br>jPEGReader->SetFileName 
( inputFilename.c_str() );<br><br>// Create a 
plane<br>vtkSmartPointer<<wbr>vtkPlaneSource> plane 
=<br>vtkSmartPointer<<wbr>vtkPlaneSource>::New();<br>plane->SetCenter(0.0, 
0.0, 0.0);<br>plane->SetNormal(0.0, 0.0, 1.0);<br><br>// Apply the 
texture<br>vtkSmartPointer<vtkTexture> texture 
=<br>vtkSmartPointer<vtkTexture>::<wbr>New();<br>texture->SetInputConnection(<wbr>jPEGReader->GetOutputPort());<br><br>vtkSmartPointer<<wbr>vtkTextureMapToPlane> 
texturePlane 
=<br>vtkSmartPointer<<wbr>vtkTextureMapToPlane>::New();<br>texturePlane-><wbr>SetInputConnection(plane-><wbr>GetOutputPort());<br><br>vtkSmartPointer<<wbr>vtkPolyDataMapper> 
planeMapper 
=<br>vtkSmartPointer<<wbr>vtkPolyDataMapper>::New();<br>planeMapper-><wbr>SetInputConnection(<wbr>texturePlane->GetOutputPort())<wbr>;<br><br>vtkSmartPointer<vtkFollower> 
texturedPlane 
=<br>vtkSmartPointer<vtkFollower>::<wbr>New();<br>texturedPlane->SetMapper(<wbr>planeMapper);<br>texturedPlane->SetTexture(<wbr>texture);<br><br><br>// 
Visualize the textured plane<br>vtkSmartPointer<vtkRenderer> renderer 
=<br>vtkSmartPointer<vtkRenderer>::<wbr>New();<br>renderer->AddActor(<wbr>texturedPlane);<br><br>renderer->SetBackground(.1, 
.2, .3); // Background color dark 
blue<br>renderer->ResetCamera();<br><br>texturedPlane->SetCamera(<wbr>renderer->GetActiveCamera());<br><br><br>vtkSmartPointer<<wbr>vtkRenderWindow> 
renderWindow 
=<br>vtkSmartPointer<<wbr>vtkRenderWindow>::New();<br>renderWindow->AddRenderer(<wbr>renderer);<br><br>vtkSmartPointer<<wbr>vtkRenderWindowInteractor> 
renderWindowInteractor 
=<br>vtkSmartPointer<<wbr>vtkRenderWindowInteractor>::<wbr>New();<br>renderWindowInteractor-><wbr>SetRenderWindow(renderWindow);<br><br>renderWindow->Render();<br><br>renderWindowInteractor->Start(<wbr>);<br><br>return 
EXIT_SUCCESS;<br>}<br></div>
<div> </div>
<div> </div></div></div></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>