We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, does anyone know how to change a color in this example. So I would like to have close points in red color and far in blue.
import org.openkinect.processing.*;
Kinect kinect;
void setup() {
colorMode(HSB, 360, 180, 180);
size(512, 424, P3D);
kinect = new Kinect(this);
kinect.initDepth();
}
void draw() {
background(0);
PImage img = kinect.getDepthImage();
//image(img, 0, 0);
int skip = 9;
for (int x = 0; x < img.width; x+=skip) {
for (int y = 0; y < img.height; y+=skip) {
int index = x + y * img.width;
float b = brightness(img.pixels[index]);
float z = map(b, 0, 255, 60, -250);
fill(0,100,80);
pushMatrix();
translate(x, y, z);
ellipse(0, 0, skip/2, skip/2);
popMatrix();
}
}
}
Answers
https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text#latest
It is required you get the formatting for your code right first. And don't start multiple new discussions for the same project. Seriously. Listen. This is DAMN FINE ADVICE you're getting here.