I was wondering the VTK syntax to do this though. The VTK users guide only shows how to use vtkTextureMapToPlane (which I got to work successfully). Since I no longer have a plane, I didn't know how to apply the texture.<br>
<br>I got it to work though - here is an example of how to add texture coordinates to a polydata and then texture map a quad:<br>
<br><a href="http://www.vtk.org/Wiki/Texture_map_a_quad" target="_blank">http://www.vtk.org/Wiki/Texture_map_a_quad</a><br><br clear="all">Thanks,<br><br>David<br>
<br><br><div class="gmail_quote">On Tue, Nov 17, 2009 at 1:17 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You need to define texture coordinates for each point in the polydata.<br>
Texture coordinates are part of a polydata's pointdata. Then you need<br>
to assign a texture the actor that contains the polygon.<br>
<br>
Texture coordinate (0,0) corresponds to pixel (0,0) and coordinate<br>
(1,1) corresponds to the last pixel in the texture.<br>
<br>
I think the vtk textbook explains all of this. Actually, any computer<br>
graphics book will do the same. Generating texture coordinates for<br>
arbitrary shapes is still a research problem.<br>
<br>
Bill<br>
<div><div></div><div><br>
On Tue, Nov 17, 2009 at 1:06 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>> wrote:<br>
> I can texture map a plane:<br>
> <a href="http://www.vtk.org/Wiki/Texture_map_a_plane" target="_blank">http://www.vtk.org/Wiki/Texture_map_a_plane</a><br>
><br>
> But how would I texture map a polygon? Say I have 4 points that define a<br>
> quad (lets say a rectangle) - how would I map an image onto this polygon?<br>
><br>
> Thanks,<br>
><br>
> David<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>