[vtkusers] Blinking/Glowing an actor
srikanth bhattad
srikanthviit at gmail.com
Tue Dec 11 18:49:52 EST 2012
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
for (i = 1; i < 360; i++)
{
if (i % 2 ==0) // if i is even number
{
coneActor2->GetProperty()->SetColor(0.2, 0.63, 0.79);}// change
to color 1
else // if is odd number
{
coneActor2->GetProperty()->SetColor(0.7, 0.2, 0.19);} // change
to color 2
// render the image
renWin->Render();
//iren->Initialize();
//iren->Start();
// rotate the active camera by one degree
ren1->GetActiveCamera()->Azimuth( 10 );
Sleep(2000);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121211/9a0a4cd4/attachment.htm>
More information about the vtkusers
mailing list