# Processing and Kinect 360: gesture and fullscreen scaling

**URL:** https://discourse.processing.org/t/processing-and-kinect-360-gesture-and-fullscreen-scaling/572
**Category:** Coding Questions
**Created:** [May 31, 2018, 7:13pm UTC](https://discourse.processing.org/t/processing-and-kinect-360-gesture-and-fullscreen-scaling/572 "2018-05-31T19:13:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![grood](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@grood](https://discourse.processing.org/u/grood)
#### Post date: [May 31, 2018, 7:13pm UTC](https://discourse.processing.org/t/processing-and-kinect-360-gesture-and-fullscreen-scaling/572/1 "2018-05-31T19:13:07Z")

</div>

Hi, im a newbie in Processing and need some help or advice.  
i just found free to share code by one guys(is just painting with stroke and random colors) and i add fews feature with minim lib. Basically u can paint with kinect and change colors and stroke depends volumes.  
My first question can i use gesture/volumes to save instead using keyboard? example: would like to save with left hand up :), or using volume when i reach high levels.  
Second, i know kinect 360 just can handle with 480x640, im want bigger canvas like fullscreen. Can i Rescale it without effect on my lines ? i tried fullscreen but the area where i can paint is just same.

```auto
import SimpleOpenNI.*;
import fullscreen.*;
import ddf.minim.analysis.*;
import ddf.minim.*;
SimpleOpenNI kinect;

int closestValue;
int closestX;
int closestY;

float lastX;
float lastY;

int previousX;
int previousY;
Minim minim;
AudioInput input;
FFT fft;
void setup()
{
  size(640, 480);
  kinect = new SimpleOpenNI(this);
  kinect.enableDepth();
  
  minim = new Minim(this);
  input = minim.getLineIn();
  fft = new FFT(input.bufferSize(),input.sampleRate());
  background(255);
 

}
void draw()
{
  closestValue = 8000;
  
  kinect.update();
  
  int[] depthValues = kinect.depthMap();
  
  for(int y = 0; y < 480; y++){
    for(int x = 0; x < 640; x++){
      int reversedX = 640-x-1;
      int i = reversedX + y * 640;
      int currentDepthValue = depthValues[i];
      
      //nejnizsi hodnota vs vzdalenost
      //620 nebo 2m minimum
      //1525 nebo 5m maximum
      if(currentDepthValue > 610 && currentDepthValue < 1525
      && currentDepthValue < closestValue){
        
        closestValue = currentDepthValue;
        closestX = x;
        closestY = y;
      }
    }
  }
  
  float interpolatedX = lerp(lastX, closestX, 0.3f);
  float interpolatedY = lerp(lastY, closestY, 0.3f);

  
  
  fft.forward(input.mix);
  float max = 0.0;
  for(int i = 0; i < fft.specSize();i++)
  {
    float loudness = fft.getBand(i);
    if (loudness > max) {
      max = loudness;
    }
  }
  stroke(max%254.0,max%150.0+5,max%200.0+3);
  strokeWeight((max%100.0)+1);
        //hlasitost od 4 do 30/ max, pro nekonecna hodnota.    

  line(lastX, lastY, interpolatedX, interpolatedY);
  lastX = interpolatedX;
  lastY = interpolatedY;

}
void mousePressed(){
  save("pollock.png");
  background(255);
}
      
      

```

Thanks for helps and advice, and sorry for my bad english 🙂

---

<div class="post-metadata">

### Author: ![grood](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@grood](https://discourse.processing.org/u/grood)
#### Post date: [June 2, 2018, 12:28pm UTC](https://discourse.processing.org/t/processing-and-kinect-360-gesture-and-fullscreen-scaling/572/2 "2018-06-02T12:28:57Z")

</div>

now i need just scale canvas up, any idea or help please ?
