[vtkusers] vtkTexture and vtkPlaneSource

Gökhan ERSOY goksoy66 at gmail.com
Fri Sep 12 17:07:19 EDT 2008


Hi all,

I've made a plane using vtkTexture and vtkPlaneSource. The image file which
used for vtkTexture has dimensions of 487x600. When it is rendered, it is
converted to 1x1 "square" plane. I want the image dimension rates to remain
same. Is there a parameter for this? How can i do this? The following is my
code snippet.


public static vtkActor[] createActors(String lhs, String rhs) {
        vtkActor[] actors = new vtkActor[2];

        vtkJPEGReader reader = new vtkJPEGReader();
        reader.SetFileName(lhs);
        reader.Update();
        vtkTexture texture = new vtkTexture();
        texture.SetInputConnection(reader.GetOutputPort());
        texture.InterpolateOn();

        vtkPlaneSource plane = new vtkPlaneSource();
        vtkPolyDataMapper planeMapper = new vtkPolyDataMapper();
        planeMapper.SetInputConnection(plane.GetOutputPort());
        vtkActor planeActor = new vtkActor();

        planeActor.SetMapper(planeMapper);
        planeActor.SetTexture(texture);
        planeActor.SetOrientation(0, 0, 0);

        ...

        actors[0] = planeActor;
        actors[1] = plane2Actor;

        return actors;
}



I need help in urgent. :(

Thanks...

Gokhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080913/138274a1/attachment.htm>


More information about the vtkusers mailing list