We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Turning off Lights mid-loop
Page Index Toggle Pages: 1
Turning off Lights mid-loop (Read 831 times)
Turning off Lights mid-loop
Oct 6th, 2006, 6:35am
 
This might be a stupid question, but how can I turn off a light once it's created without waiting for draw() to finish? I'm trying to draw some objects with different lights in an arbitrary order.

I'm thinking of the processing alpha that had the noLights() method. Is that possible?

Thanks!
ryan
Re: Turning off Lights mid-loop
Reply #1 - Oct 13th, 2006, 8:06am
 
Well, as far as I've been into processing, I guess even turning off the light mid loop will be of no use coz no graphic is displayed until draw() is completed.
Re: Turning off Lights mid-loop
Reply #2 - Oct 16th, 2006, 8:19am
 
Ryan, try doing the following, it works for me with 0119 code.

Code:
g.lightCount=0; 

Re: Turning off Lights mid-loop
Reply #3 - Oct 17th, 2006, 2:25am
 
Thanks Marius that works great!

sd, I think that stuff is always being drawn to the frame buffer, which gets displayed at the end of the frame, so turning lights on and off has an effect as stuff gets drawn, like fill() and stuff.. At least as far as I know.
Page Index Toggle Pages: 1