I am a beginner in Processing. I am trying to play with my kinect and to simulate a light/shade effect on a body shape.
My first question is about the relation between stroke and light effect. I managed to get a shade effect on a sphere if there is noStroke(). Why the fact to set a stroke value makes the shade effect fail ?
pointLight(250, 250, 250, 0, 750, 1000);
noStroke();
//stroke(250.0,250.0,250.0); // with or without stroke
translate(0,0,500.0);
fill(250,250,250);
sphere(100);
My second question is about the 3D body shape obtained thanks to the Kinekt. I got the 3D body shape through some basic codes (proposed in SimpleOpenNI examples) :
beginShape(POINTS);
for(int y=0;y < context.depthHeight();y+=10)
{
for(int x=0;x < context.depthWidth();x+=10)
{
index = x + y * context.depthWidth();
if(depthMap[index] > 0)
{
// draw the projected point
realWorldPoint = context.depthMapRealWorld()[index];
point(realWorldPoint.x,realWorldPoint.y,realWorldPoint.z);
}
}
}
endShape();
but the light has no effect on it. I have the intuition that is linked to the first question. Maybe a list of Points doesn't make a solid texture and so no light effect on it.
Could someone answer my two questions and give me some hints to produce a 3D body shape with a shade effect ?
Any recommended tutorial on the subject is much welcome as well :D !
SimpleOpenNI context;
float zoomF =0.5f;
float rotX = radians(180); // by default rotate the hole scene 180deg around the x-axis,
// the data from openni comes upside down
float rotY = radians(0);
boolean autoCalib=true;
void setup()
{
size(1024,768,P3D); // strange, get drawing error in the cameraFrustum if i use P3D, in opengl there is no problem
context = new SimpleOpenNI(this);
if(context.isInit() == false)
{
println("Can't init SimpleOpenNI, maybe the camera is not connected!");
exit();
return;
}