Hi there,
I have an issue with PGraphics3. Its not working for me at all and of course its me, but I cant figure out how to get it to run.
Please check the following code:
Code:
import processing.opengl.*;
PGraphics3 p;
void setup()
{
size(400,400, OPENGL);
p = new PGraphics3(200,200, null);
p.defaults();
}
void draw()
{
background(#0000FF);
p.tint(255,0,0); // nope
p.fill(color(255,0,0,100)); // nope
p.stroke(#FF00FF); //yes!
p.strokeWeight(10); //nope
p.line(10,10,190,190);
image(p,100,100);
}
My goal is to have a by default transparent Pgraphics3 Image and draw on that on top of other stuff.
Manuel
Edit:
what is happening here??
Use P3P instead of size, its ok as usual....
Code:
import processing.opengl.*;
PImage test;
PGraphics3 maske;
void setup()
{
size(400,400, OPENGL);
test = new PImage(200,200);
maske = new PGraphics3(200,200,null);
maske.defaults();
}
void draw()
{
for(int i=0;i< 200*200;i++)
{
test.pixels[i] = #FF0000;
}
maske.fill(#00000F);
maske.rect(10,10,100,100);
test.mask(maske);
test.updatePixels();
image(test, 100,100);
}