Light drawing: make 2 light sources interact with eachother

edited January 2018 in Library Questions

I'm new to processing and have been doing light drawing tutorial (no. 150). Just wondering if it's possible to include a second light source, maybe a red and a white light, and have something happen when the 2 cross paths. Is this possible and how would I go about it? thanks in advance!


  • Should be. Hard to know without seeing a running example.

  • edited January 2018
    Capture cam;
    void setup() {
        size(320, 240);
        String[] cameras = Capture.list();          
        cam = new Capture(this, 320, 240, cameras[0]);    
    void captureEvent(Capture cam) 
    void draw()
      image(cam, 0, 0);                      
      for(int i = 0; i < cam.pixels.length; i++)                                  
        if(brightness(cam.pixels[i]) > 230)            
           cam.pixels[i] = color(255);                  // makes it white [had to specify cam.pixels]
  • This is what I have so far, which isn't fully working either.. any help appreciated!

  • You don't need line 22. Line 29 should be pixels[i]=color(255);

    Can you tell us what is a light source in your concept?


  • Thanks for the reply! I am thinking a small bright bike light or something similar, I'm getting it to pick up the brightest points (using phone light) now but I need to make the light 'draw' and for that to stay on screen

  • @ga77 -- once you are registering your traces, you might find this previous discussion useful for making your two traces interact:


  • Thanks for all the help!

Sign In or Register to comment.