//sketch_ControlP5_Slider import controlP5.*; ControlP5 cp5; void setup() { size(400,400,P3D); noStroke(); cp5 = new ControlP5(this); cp5.addSlider("Lx") .setPosition(0,0) .setSize(100,20) .setRange(0,300) .setColorLabel(color(0)) .setValue(100); cp5.addSlider("Ly") .setPosition(0,20) .setSize(100,20) .setRange(0,300) .setColorLabel(color(0)) .setValue(100); } void draw() { pushMatrix(); lights(); background(255); fill(0, 160, 100); translate(width / 2, height / 2); rotateY(map(mouseX, 0, width, -PI/1, PI/1)); rotateX(map(mouseY, 0, height, PI/1, -PI/1)); float Lx = cp5.getController("Lx").getValue(); float Ly = cp5.getController("Ly").getValue(); box(Lx,Ly,100); popMatrix(); }