[vtkusers] Texture map a polygon

David Doria daviddoria+vtk at gmail.com
Tue Nov 17 13:37:07 EST 2009


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.

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:

http://www.vtk.org/Wiki/Texture_map_a_quad

Thanks,

David


On Tue, Nov 17, 2009 at 1:17 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> You need to define texture coordinates for each point in the polydata.
> Texture coordinates are part of a polydata's pointdata. Then you need
> to assign a texture the actor that contains the polygon.
>
> Texture coordinate (0,0) corresponds to pixel (0,0) and coordinate
> (1,1) corresponds to the last pixel in the texture.
>
>  I think the vtk textbook explains all of this. Actually, any computer
> graphics book will do the same. Generating texture coordinates for
> arbitrary shapes is still a research problem.
>
> Bill
>
> On Tue, Nov 17, 2009 at 1:06 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>>
> wrote:
> > I can texture map a plane:
> > http://www.vtk.org/Wiki/Texture_map_a_plane
> >
> > But how would I texture map a polygon? Say I have 4 points that define a
> > quad (lets say a rectangle) - how would I map an image onto this polygon?
> >
> > Thanks,
> >
> > David
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091117/0c8b71d9/attachment.htm>


More information about the vtkusers mailing list