Lit edges?
in
Programming Questions
•
1 year ago
Hi!
I'm trying to render a cube as a lit edges skeleton (see code below). Strokes are not affected by lights in any rendering modes and I dont find how to do it.
Thanks for your help!
void setup()
{
size(640, 360, P3D);
stroke(255);
noFill();
}
void draw()
{
background(0);
translate(width / 2, height / 2);
// Orange point light on the right
pointLight(150, 100, 0, // Color
200, -150, 0); // Position
rotateY(map(mouseX, 0, width, 0, PI));
rotateX(map(mouseY, 0, height, 0, PI));
box(150);
}
I'm trying to render a cube as a lit edges skeleton (see code below). Strokes are not affected by lights in any rendering modes and I dont find how to do it.
Thanks for your help!
void setup()
{
size(640, 360, P3D);
stroke(255);
noFill();
}
void draw()
{
background(0);
translate(width / 2, height / 2);
// Orange point light on the right
pointLight(150, 100, 0, // Color
200, -150, 0); // Position
rotateY(map(mouseX, 0, width, 0, PI));
rotateX(map(mouseY, 0, height, 0, PI));
box(150);
}
1