public void lights() { g.lights(); }
/** * ( begin auto-generated from lights.xml ) * * Sets the default ambient light, directional light, falloff, and specular * values. The defaults are ambientLight(128, 128, 128) and * directionalLight(128, 128, 128, 0, 0, -1), lightFalloff(1, 0, 0), and * lightSpecular(0, 0, 0). Lights need to be included in the draw() to * remain persistent in a looping program. Placing them in the setup() of a * looping program will cause them to only have an effect the first time * through the loop. * * ( end auto-generated ) * * @webref lights_camera:lights * @usage web_application * @see PGraphics#ambientLight(float, float, float, float, float, float) * @see PGraphics#directionalLight(float, float, float, float, float, float) * @see PGraphics#pointLight(float, float, float, float, float, float) * @see PGraphics#spotLight(float, float, float, float, float, float, float, float, float, float, float) * @see PGraphics#noLights() */ public void lights() { if (recorder != null) recorder.lights(); g.lights(); }
PGraphics pg; void setup() { size(200, 200, P2D); pg = createGraphics(100, 100, P3D); } void draw() { pg.beginDraw(); pg.background(0); pg.noStroke(); pg.translate(pg.width*0.5, pg.height*0.5); pg.lights(); pg.sphere(25); pg.endDraw(); background(0, 0, 255); image(pg, 50, 50); }
v.beginDraw(); v.background(102); v.lights(); v.pushMatrix(); v.camera(x+eyeoff, y, 300, px, py, 0, 0.0, 1.0, 0.0);