[vtkusers] rotating a 2D actor

Pankaj Daga deluded.soul at gmail.com
Mon Oct 2 11:55:19 EDT 2006


Hi there,

This looks luch better! However, I cannot get it to show.

I am calling the SetPosition() method as follows:

m_actor->SetPosition(x, y, 1.0);

I tried various values for the Z position but it just does not show it...
Seems to load everything fine though and there are no error messages.

Thanks,

Pankaj

On 10/2/06, David Gobbi <dgobbi at atamai.com> wrote:
>
> Hi Pankaj,
>
> If you are using VTK 5, you should be able to use vtkImageActor and then
> just set a rotation transform for the actor.  That way you won't have to
> mess around with mappers and textures.  The only thing you would have to
> worry about is getting the center-of-rotation right.
>
> - David
>
>
> Pankaj Daga wrote:
> > Hi guys,
> >
> > I am trying this idea of using vtkActor and vtkMapper and then
> > converting the image to an OpenGL texture.
> >
> > However, I have one problem now... Which vtkMapper based object will
> > actually work with vtkImageData. The only class that I can see is
> > vtkImageMapper and that only works with 2D actors.
> >
> > Thanks,
> > Pankaj
> >
> > On 10/2/06, *Pankaj Daga* <deluded.soul at gmail.com
> > <mailto:deluded.soul at gmail.com>> wrote:
> >
> >     Hi,
> >
> >     That's an idea worth trying. I will definitely give it a shot...
> >
> >     Thanks again,
> >
> >
> >     Pankaj
> >
> >     On 10/2/06, * Kalpathi Subramanian* < krs at uncc.edu
> >     <mailto:krs at uncc.edu>> wrote:
> >
> >         One way to to do this is to make a texture(vtkTexture) out of
> >         this image and then map it on to vtkPlaneSource (I think thats
> >         right, just
> >         use a single quadrilateral). Then that object can be
> >         transformed as you please.  The texture is input to the actor
> >         (there is a actor
> >         method for this)..
> >
> >         I have done this long time back..
> >
> >
> >             == krs
> >
> >
> >         Pankaj Daga wrote:
> >>         Hi Kalpathi,
> >>
> >>         Thanks for replying.
> >>
> >>         Basically, I have a PNG imag that I read using vtkPNGReader
> >>         and display it using vtkActor2D and vtkImageMapper objects.
> >>         So, I just wanted to do a simple 2D rotation on it.
> >>
> >>         Cheers and thanks,
> >>
> >>         Pankaj
> >>
> >>         On 10/2/06, *Kalpathi Subramanian* <krs at uncc.edu
> >>         <mailto:krs at uncc.edu>> wrote:
> >>
> >>             Pankaj:
> >>
> >>             There is no transformation matrix associated with 2D
> >>             actors and hence you cannot transform it (like rotate)..
> >>             if you
> >>             need to transform your objects use vtkActor.  Tell us
> >>             what object you need to rotate in your app and we might be
> >>             able to offer suggestions.  (again, read the vtk doc for
> >>             vtkAcor2D you will see this in the description).
> >>
> >>                 == krs
> >>
> >>
> >>             Pankaj Daga wrote:
> >>>             Hi there,
> >>>
> >>>             @Tony: I am a bit confused as to how a vtkCubeAxesActor2D
> fits into this??? Could you elaborate a bit
> >>>
> >>>             Posting my original message again, as the old one is in
> September thread.
> >>>
> >>>             I have a vtkActor2D object that I wish to rotate. Is there
> a simple way to
> >>>
> >>>
> >>>
> >>>             rotate it about its center?
> >>>
> >>>             I know all vtkProp3D based objects have built in rotation
> functions. How can
> >>>
> >>>             I implement something similar in a vtkActor2D?
> >>>
> >>>             Basically, I have a 2D image that I wish to rotate on the
> screen.
> >>>
> >>>
> >>>
> >>>
> >>>             Thanks,
> >>>
> >>>             Pankaj
> >>>
> ------------------------------------------------------------------------
> >>>
> >>>             _______________________________________________
> >>>             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
> >>>
> >>
> >>             --
> >>             K.R.Subramanian                        Phone: (704)
> 687-8579
> >>             Department of Computer Science         FAX:   (704)
> 687-3516
> >>             UNC Charlotte, Woodward 435E           Email:
> >>
> >>
> >>             krs at uncc.edu <mailto:krs at uncc.edu>
> >>             Charlotte, NC 28223-0001               Web:
> http://www.cs.uncc.edu/~krs <http://www.cs.uncc.edu/%7Ekrs>
> >>
> >>
> >>
> >
> >         --
> >         K.R.Subramanian                        Phone: (704) 687-8579
> >         Department of Computer Science         FAX:   (704) 687-3516
> >         UNC Charlotte, Woodward 435E           Email:
> >
> >         krs at uncc.edu <mailto:krs at uncc.edu>
> >         Charlotte, NC 28223-0001               Web:
> http://www.cs.uncc.edu/~krs <http://www.cs.uncc.edu/%7Ekrs>
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061002/cc0fce6c/attachment.htm>


More information about the vtkusers mailing list