[vtkusers] textures and vtkPolyData (missing scalars?)
Wiebke Timm
wiebke.timm at uni-bielefeld.de
Tue Mar 9 09:57:51 EST 2004
Hi!
On 09.03.2004, at 10:33, de Boer Ingo wrote:
> I am not sure about the scalars, I looked at the code you sent
> before. Could it be that you are missing the Texture coordinates ?
Yeah, I didn't know I have to set something like that. Didn't program
anything 3D before. It wasn't covered in any example in the API
documentation or the vtk Users Guide. Can you point me to some compact
documentation about mapping texture coordinates to 3D objects?
> Look at my sample beneath. It works fine for me.
Thanks! I'll try.
Just because I want to learn: Shouldn't...
ptexmap = vtkTextureMapToPlane::New();
ptexmap->SetInput(this->GetData());
pTransform = vtkTransformTextureCoords::New();
pTransform->SetInput(ptexmap->GetOutput());
pTransform->SetScale(3,3,1);
[...]
pmap->SetInput( (vtkPolyData*) (pTransform->GetOutput()) );
...apply the setting of texture coordinates for me automagically?
("this" is a vtkPolyData, and "pmap" is a vtkPolyDataMapper)
Because the API documentation vor vtkTextureMapToPlane says:
"vtkTextureMapToPlane is a filter that generates 2D texture coordinates
by mapping input dataset points onto a plane. The plane can either be
user specified or generated automatically. (A least squares method is
used to generate the plane automatically.)"
So there _should_ be scalars after pmap is set as input for my actor, I
don't have to set them manually if I'm not mistaken...
Ciao!
Wiebke
More information about the vtkusers
mailing list