[vtkusers] Problems with plane texture map

Mdl mdl78 at libero.it
Sun Oct 27 19:06:01 EST 2002


Hi everybody,

I'm using VTK since July for my final assignment, and till now I managed to
avoid asking help by spending a lot of time on the tutorials and manual
pages, but... now I really need a hand!

I'm having some problems with vtkTextureMapToPlane. I have to texturize a 3D
model of an ancient theater, basicly planar (it's just the front of the
theater, the "facade"). It is made of, let's say, a "big box", and some
pillars laying a bit closer to the imaginary observer looking at its front
side.

Let's try to do some Ascii art (?)... viewing from the top:
________________________....
_____    __________    _____....
         I__I                 I__I

Got it (despite my english)? Hope so.

Now, the problem is that I am using a perfectly planar texture map
(representing a color map), as big as the facade, but I get some wrong color
spots on the top of the pillars... I made some theories:
1) it's a bit like if the texture isn't mapped in a perfectly hortogonal way
to the facade, but with a little angle... maybe?
2) the texture "fades" in the outer points.. the points far from the center
are differently coloured
3) the 3D polydata come from a decimated STL model.. maybe the DecimatePro
filter introduces some problem? (this is quite unlikely, but.. you never
know :-)

I cut&paste some code:

tPuddinga = vtkTexture::New();

tPuddinga->SetInput(myMap->GetMap());    // myMap->GetMap() is a method
returning a vtkImageData*

tPuddinga->RepeatOff();

tmPuddinga = vtkTextureMapToPlane::New();

tmPuddinga->AutomaticPlaneGenerationOn();

tmPuddinga->SetOrigin (0, 0, 0);

tmPuddinga->SetSRange(0, 1);

tmPuddinga->SetTRange(0, 1);

tmPuddinga->SetInput (riduttore->GetOutput());    // riduttore is the
DecimatePro filter

...and so on, just trivial code.

Anyone out there has got a clue?
I thank you very much in advance.

Marco






More information about the vtkusers mailing list