[vtkusers] vtkTexture and vtkPlaneSource

Imran Khan khan.imranh at gmail.com
Fri Sep 19 14:54:34 EDT 2008


Gokhan:

You need to set Point1, Point2 and origin of the vtkPlaneSource to establish
the size of the output image.

Imran


Gökhan ERSOY wrote:
> 
> 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
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://www.nabble.com/vtkTexture-and-vtkPlaneSource-tp19464160p19577756.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list