[vtkusers] Blinking/Glowing an actor

David Doria daviddoria at gmail.com
Wed Dec 12 08:00:32 EST 2012


On Tue, Dec 11, 2012 at 6:49 PM, srikanth bhattad <srikanthviit at gmail.com>wrote:

>
> Hi, I am a newbie in VTK coding. I have VTK 5.10 installed on my PC
> running windows XP.. I am trying to develop an application where I need to
> blink or glow or change the color of an actor. I am trying out on one of
> the demo example cone4 that came with the source code. My apologies if its
> a stupid question but I was wondering if I can change the properties of
> actor like color while it is rendered and running the window-interactor.
> Since from what I have understood, once the interactor runs, the actor can
> be moved but I cant seem to change its properties since it continues the
> interactor loop. I have a snippet of the code I am running, may be it might
> help to understand what I intend to do. The cone moves and changes color at
> every iteration (2 second per iteration). But if I also simultaneously want
> to interact which I try to do by uncommenting the highlighted text, it wont
> serve the purpose. Any thoughts of how I can accomplish this blinking
> actor. I would really appreciate your help.
>
> Thanks,
> Srikanth
>

You should almost never have code after the interactor->Start() call. You
need to use callbacks/events. Here is an example of using a timer to call a
callback function:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation . Inside the
callback you can do whatever you want, including change the color of an
actor (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ColorAnActor).

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121212/cf727996/attachment.htm>


More information about the vtkusers mailing list