[vtkusers] create a texture map for an arbitrary surface
John Biddiscombe
john.biddiscombe at mirada-solutions.com
Tue Jul 22 06:30:10 EDT 2003
Tim,
> If you have a routine
> that allows the
> user to paint the pixels in the texture image by pointing at
> the teapot
> with the mouse then the paint they apply may appear not only
> where they
> want but also somewhere else on the teapot! The same is true
> of the other
> TextureMapTo* filters.
OK. So you want to explicitly give cell number N, texture coords u1,u2,u3...
cell N+1 completely different coords (not necessarily spatially related to the previous cell)
PolydataIn->Map Cells to arbitrary texture space ->Polydataout
where "Map Cells to arbitrary texture space" efeectively does a mapping and point duplication (if necessary) for every cell based upon the specified (or user generated) cell->tex table.
hmmm....
no, there's no easy way I don't think. Or at least no way that doesn't involve you doing all the cell manipulation yourself - the actual implementation wouldn't be too bad (lots of clesses like normal generation with splitting on do point duplication and you could use most of that code). Getting the cell->tex mapping that's needed as input would be a serious pain though!
$0.02
JB
>
> I was wondering if there was some standard way of mapping an
> arbitrary set
> of polygons to the unit square of the texture image such that
> no polygon
> overlaps with any other. My idea was simply to map the
> triangles onto a
> grid (http://www.eastman.ucl.ac.uk/~thutton/tri_grid.jpg) but
> I wasn't sure
> if that was a good idea and was wondering if anyone else knew
> of a way to
> approach this. Of course multiple texture images is one solution.
>
> I'm not actually writing a painting routine, I just want to texture a
> surface such that each bit of surface gets its own bit of
> texture (for
> human faces).
>
> Tim.
>
>
>
> At 10:27 22/07/2003 +0100, John Biddiscombe wrote:
> >Tim,
> >
> >What do you mean? TextureMapToPlane effectively maps a unit
> square to your
> >dataset (you supply the extents of the plane though). In
> what way will you
> >be doing things different?
> >
> > > My thought is to simply map the list of triangles (ideally
> > > polygons) onto
> > > the unit square using a grid layout
> >
> >Care to elucidate?
> >
> >JB
> >
> > > -----Original Message-----
> > > From: Tim Hutton [mailto:T.Hutton at eastman.ucl.ac.uk]
> > > Sent: 21 July 2003 16:56
> > > To: VTK Users
> > > Subject: [vtkusers] create a texture map for an arbitrary surface
> > >
> > >
> > > Hello vtk users,
> > >
> > > I would like to create a texture map for an arbitrary
> > > polygonal surface
> > > (for example, to enable painting of any 3D object) - is there
> > > an easy way
> > > to do this in VTK? I don't want to use vtkTextureMapToPlane
> > > or similar
> > > because these don't guarantee a unique bit of texture for
> > > each part of the
> > > object.
> > >
> > > My thought is to simply map the list of triangles (ideally
> > > polygons) onto
> > > the unit square using a grid layout, and use that for the texture
> > > coordinates (duplicating vertices as necessary). Has anyone
> > > done something
> > > similar? Would such a class be useful in VTK?
> > >
> > > Thanks,
> > >
> > > Tim.
> > >
> > >
> > > --------------------------------------------------------------
> > > -------------
> > > Tim Hutton,
> > > http://www.eastman.ucl.ac.uk/~dmi/MINORI
> > > Research Fellow & PhD student,
> > > T.Hutton at eastman.ucl.ac.uk
> > > MINORI Project, Biomedical Informatics Unit,
> > > Eastman Dental Institute, UCL, Tel: [+44]
> > > (0)20 7915 2344
> > > 256 Gray's Inn Road, London WC1X 8LD, UK Fax: on request
> > > --------------------------------------------------------------
> > > -------------
> > > This email represents the views of the sender alone and
> must not be
> > > construed as representing the views of the Eastman Dental
> > > Institute. It may
> > > contain confidential information and may be protected by law
> > > as a legally
> > > privileged document and copyright work. Its content should
> > > not be disclosed
> > > and it should not be given or copied to anyone other than the
> > > person(s)
> > > named or referenced above. If you have received this email in
> > > error, please
> > > contact the sender.
> > >
> > >
> > > _______________________________________________
> > > This is the private VTK discussion list.
> > > Please keep messages on-topic. Check the FAQ at:
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://www.vtk.org/mailman/listinfo/vtkusers
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
More information about the vtkusers
mailing list