[vtkusers] Per triangle texturing. Please help!!
Tim Hutton
tim.hutton at gmail.com
Mon Sep 3 08:00:07 EDT 2007
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/
More information about the vtkusers
mailing list