[vtkusers] vtkTextureMapToPlane plane definition
Christophe Franco
cfranco at amsatec.fr
Wed Oct 22 04:26:00 EDT 2003
I'm trying to display an image as a texture on a plane, using
vtkTextureMapToPlane class. I'm using the following code :
vtkPNGReader* reader = vtkPNGReader::New();
reader->SetFileName("test.png"); // File in AmsaView directory
reader->Update();
vtkTextureMapToPlane* imageTexture = vtkTextureMapToPlane::New();
imageTexture->AutomaticPlaneGenerationOff();
imageTexture->SetInput(reader->GetOutput());
imageTexture->SetOrigin(0, 0, 0);
imageTexture->SetPoint1(0, 1, 0);
imageTexture->SetPoint2(0, 0, 1);
vtkDataSetMapper* imageMapper = vtkDataSetMapper::New();
imageMapper->SetInput(imageTexture->GetOutput());
vtkActor* actor = vtkActor::New();
actor->SetMapper(imageMapper);
actor->SetPosition(-110, -338, 785);
The result is, the image is displayed at the wanted position, but the
plane is always along X-Y axes. No matter what values I use in the
SetOrigin, SetPoint1 and SetPoint2 methods, the result is always exactly
the same.
A also tried using the alternate method to define the plane with its
origin and normal, and I still got the same result.
Is there something I am doing wrong ?
More information about the vtkusers
mailing list