[vtkusers] Repositioning Image within Render Window

Alexis Cheng acheng_1221 at hotmail.com
Wed Oct 20 19:14:05 EDT 2010


Hi,

Thanks for all the suggestions.

I am using vtkActor because it allows me to map an image onto a polygon of a specified shape. Is there a similar functionality available to vtkImageActor?

I currently have a camera correctly positioned to show another image as the background of the render window. Is it feasible to create another camera to show the scene image or reposition the scene image with respect to the camera?

Thanks,
Alexis Cheng
Electrical Engineering
University of British Columbia

> From: david.gobbi at gmail.com
> Date: Wed, 20 Oct 2010 16:40:03 -0600
> Subject: Re: [vtkusers] Repositioning Image within Render Window
> To: daviddoria at gmail.com
> CC: vtkusers at vtk.org; acheng_1221 at hotmail.com
> 
> On Wed, Oct 20, 2010 at 4:33 PM, David Doria <daviddoria at gmail.com> wrote:
> > On Wed, Oct 20, 2010 at 6:31 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> >>
> >> Hi Alexis,
> >>
> >> The vtkImageActor is the most common way of displaying an image.  It
> >> assumes that the image data is already in the correct coordinate
> >> system (and if the image is not yet in the right coordinate system,
> >> then its Origin and Spacing can be adjusted with
> >> vtkImageChangeInformation).  That is usually the best method for
> >> displaying an image.  If you try displaying an image with vtkTexture
> >> instead, then you have to take care of all the details like aspect
> >> ratio, position, texture coords, etc. yourself.
> >>
> >> And, as John said, you must also consider the camera, because it is
> >> what determines how the "World Coordinates" of the 3D scene are
> >> translated into view that you see on the computer screen.  For 2D
> >> image viewing, you usually want to set ParallelProjectionOn() and use
> >> SetParallelScale() to set how large the view is, in world coordinates.
> >>  Then set the camera FocalPoint to the center of your image, set the
> >> camera Position about 1000mm away from the focal point (i.e. looking
> >> towards it), and then set the ViewUp() so that the image will be
> >> correctly oriented on the screen.
> >>
> >>   David
> >
> > Here is an example of using an ImageActor as David G. suggested:
> > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/InteractWithImage
> 
> Except that example doesn't do anything with the camera positioning.
> It is impossible to adjust the image position without moving the
> camera, because VTK's default camera setting will always center the
> actor within the window.
> 
>   David
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101020/2a657a86/attachment.htm>


More information about the vtkusers mailing list