[vtkusers] Per triangle texturing. Please help!!

Samuel Marcos godofredoiii at gmail.com
Tue Sep 4 03:16:54 EDT 2007


Hi Tim, many thanks
I've read something similar in another thread. I've been trying to add
texture coords in a simple example using vtkjpegreader, but I don't get any
good results. What I do is to add Tcoords to a polydata, then map the
polydata whit a Polydatamapper and then add the mapper and a texture to the
actor. Is that correct?
Also I would like to keep the question of my first post hot: Is it possible
to change Polydata point values in a vtkTextureMapToPlane but keeping the
rest of the information?

On 9/3/07, Tim Hutton <tim.hutton at gmail.com> wrote:
>
> Hi Godofredo,
>
> VTK doesn't support per-face texturing natively. You can get the same
> effect by splitting the vertices - duplicating them so that at a
> junction between e.g. 6 triangles, there are 6 vertices, all with the
> same spatial coordinates but different texture coordinates.
>
> If you look in vtkOBJReader that's the approach it uses where
> necessary, to read-in the OBJ format (which does support per-face
> textures).
>
> To manipulate the texture coordinates, just use
> my_polydata->GetPointData()->GetTCoords().
>
> Tim
>
> On 03/09/07, Godofredo <godofredoiii at gmail.com> wrote:
> >
> > Sorry for replying myself but I'm frustrated. Another question I have:
> Is it
> > possible to change Polydata point values in a vtkTextureMapToPlane? I've
> > tried doing:
> >  vtkTextureMapToPlane *planeMap = vtkTextureMapToPlane::New();
> > planeMap->GetPolyDataOutput()->SetPoints(vPoints);
> > Where vPoints is the new array of point values.
> >
> > But this doesn't seem to work at all.
> >
> >
> > Godofredo wrote:
> > >
> > > Hi. I'm trying to add texture to a region of a 3d polydata. The
> texture is
> > > a .jpeg file and the polydata is a triangulated point cloud. I would
> like
> > > to know if it's possible to manually assign a region of the .jpeg
> image to
> > > each triangle. I don't know if this can be done with the tcoords
> field.
> > > Any guidance will be apreciated as I'm a bit stuck. Many thanks in
> > > andvance
> > >
> >
> > --
> > View this message in context:
> http://www.nabble.com/Per-triangle-texturing.-Please-help%21%21-tf4371233.html#a12460175
> > Sent from the VTK - Users mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
>
>
> --
> Tim Hutton - http://www.sq3.org.uk
>
> Take the Organic Builder challenge -
> http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070904/68917174/attachment.htm>


More information about the vtkusers mailing list