Texture mapping is killing me

Jordi Cabot cabot at tele.ucl.ac.be
Tue Jun 22 07:37:06 EDT 1999


Hi Will,

thanks for your answer, I've got three more questions.

1) I want to map on a mesh, a brain extracted with marching cubes. In
addition I already know the points of the mesh which should have TCoords
0,0 0.1,0 ..1,0 .... Couldn't I use this info to get the TCoords of the
mesh without using vtkTextureMapTo..?

2) I understand that vtkTextureMapToPlane/Sphere/Box .. find the TCoords
for a plane, sphere, box, etc.. given a texture map. But how does it
work when the dataset is not a plane, or a sphere,..? In my case I'm
using vtkTextureMapToPlane ,I define a plane with three points of a
brain surface where I want to place the texture map, but what is what
I'm seeing in the surface? How does it go from the plane that I define
to the surface that I input to the filter???

3) If I use RepeatOff,  with the vtkTexture, I get to limit the map to
the surface I want to map, but the rest of the brain has some traces of
the texture mapping, kind of cross that covers the hole brain. I can
make that disappear with InterpolateOff, what is going on?

4) How can I do to avoid mapping my texture to the both faces of the
surface? Right now it maps in the upper surface of the brain (what I
want) but also in the lower surface of the brain. The map traverses the
brain.


I'd appreciate if you could give me some bibliography referring to
texture mapping and the implementation you have done.

TIA,

Jordi

Will Schroeder wrote:
> 
> Hi Jordi-
> 
> We don't want to see anyone die due to vtk use :-)
> 
> > 1) What are exactly the TCoords? For what I have understood every point
> > (of polygonal data) has 2 coords (if we want to map a 2D image) which
> > correspond to the position of the image, so 0 0 is upper left, 1 1 is
> > down right. Is this correct?
> 
> Think of a texture map as a piece of wallpaper that is glued on a surface mesh. The texture coordinates indicate where to glue the texture map. The lower-left point of the texture map corresponds to texture coordinate (0,0), the upper-right (1,1).
> 
> > 2) This means that all the points of the dataset must have TCoords?
> >What if
> >I just want to color a region of my surface? If all the points of the
> >mesh have
> >TCoords associated, all of them must be mapped?
> 
> If you're going to use texture on an actor, all points require a texture coordinate. However, the points do not necessarily need to cover the entire range of texture coordinates - a common trick is to index into just a subregion of the texture. Sometimes this requires clever design of the texture map and texture coordinates.
> 
> > 3) Let's say that I have four points of the mesh which define kind of a
> >frame and I want
> >limit the texture map to this frame? Is that possible? How can I do it?
> >I guess that
> >the 4 points are assigned TCoords 0,0 1,0 0,1 and 1,1. But the rest of
> >the points(those outside the frame and those inside), what do I do with
> >them?
> 
> Consider using a 1 or two component texture (Intensity or Intensity-Alpha). The intensity will modulate the underlying color - you could use this to create a black frame and everywhere else normal color. Look at graphics/examplesTcl/motor.tcl (and the texture map it refers to) for an example. This texture map uses transparancy to cut away geometry, as well as a section of zero intensity to highlight the cut edges with black.
> 
> If you set texture coordinates >1.0 or <0.0 and the Repeat ivar is on, modulo arithmetic will be used to cycle through the texture map.
> 
> Will


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list