[vtkusers] Associate texture with polydata
Biddiscombe, John A.
biddisco at cscs.ch
Mon Nov 16 05:52:09 EST 2009
In paraview you would create a simple python script that could loop over 50 items and generate the names of poly and tex files from the loop variable. Then load each poly/tex separately and do the assign texture in your python script.
Off the top of my head, I don't know the syntax, but I've seen it done, so it's just a matter of experimentation until you get it right.
JB
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of David Doria
Sent: 16 November 2009 00:54
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Associate texture with polydata
The vtkActor has a SetTexture method that allows you to associate a vtkTexture
object with polydata. The vtkTexture is essentially a mapper that takes a
vtkImageData and turns it into an OpenGL texture.
The vtkPlaneSource should produce a polydata that already has the proper
texture coordinates to map the points of the plane to the corners of the image.
There is also a vtkTextureMapToPlane filter that can be used to add texture
coordinates to a polydata.
AFAIK none of the VTK file formats allow textures to be stored with polydata,
but they will at least save the texture coordinates.
David
Hm, I'm not sure that will help. Let me explain what I am actually trying to do. I have a text file with 50 sets of camera parameters (describing 50 camera positions and orientations). I have a folder of 50 images - one for each camera. What I am trying to do is create a plane for each camera and texture map the corresponding image onto the plane. Then I want to load the scene in paraview. You can see how I wouldn't want to select manually 50 images to map onto each of the planes. I actually don't even know how that would work if there is more than 1 plane in the polydata (if I used vtkAppendPolyData).
Do anyone have any other suggestions now that you know the full story?
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091116/f309a679/attachment.htm>
More information about the vtkusers
mailing list