3d pointLight or spotLight for flat texture.
in
Core Library Questions
•
1 year ago
Helo,
Im Cant understand why this does not work. I try to get a light on a flat image. Just as a light-blob. But for some reasen the middel dont light up. Does anybody know how the fix this?
Thanks in advances.
where is my code:
import processing.opengl.*;
PImage a;
void setup() {
size(1920, 1080, OPENGL);
a = loadImage("Big.jpg");
}
void draw() {
pushMatrix();
translate(mouseX, mouseY);
pointLight(255, 255, 255, 0, 0, 50);
popMatrix();
background(0);
noStroke();
int z = 0;
beginShape();
texture(a);
vertex(0, 0, z, 0, 0);
vertex(width, 0, z, width, 0);
vertex(width, height, z, width, height);
vertex(0, height, z, 0, height);
endShape();
}
1