//Thanks to people who helped me for this project, Dr.Chris Shaw and Pooya //importing library import controlP5.*; ControlP5 gui; ControlWindow controlBox; public float redFollowSpot = 255; float redFollowSpotDefaultVal = 0; public float greenFollowSpot = 255; float greenFollowSpotDefaultVal = 0; public float blueFollowSpot = 255; float blueDefaultVal = 0; float dimmerDefaultVal = 0; public float dimmer = 100; public float cameraPan = 1000; float cameraPanDefaultVal = 252; public float cameraTilt = 1000; float cameraTiltDefaultVal = -115; public float cameraZoom = 1000; float cameraZoomDefaultVal = 757; public float cameraRx = -2; float cameraRxDefaultVal = -0.1; public float cameraRy = -2; float cameraRyDefaultVal = 0.37; public float cameraRz = -2; float cameraRzDefaultVal = -0.2; public float positionxSpotFront1 = 1000; float positionxSpotFront1DefaultVal = 0; public float positionySpotFront1 = 1000; float positionySpotFront1DefaultVal = 0; public float redFront1 = 255; float redFront1DefaultVal = 0; public float greenFront1 = 255; float greenFront1DefaultVal = 0; public float blueFront1 = 255; float blueFront1DefaultVal = 0; public float positionxSpotFront2 = 1000; float positionxSpotFront2DefaultVal = 0; public float positionySpotFront2 = 1000; float positionySpotFront2DefaultVal = 0; public float redFront2 = 255; float redFront2DefaultVal = 0; public float greenFront2 = 255; float greenFront2DefaultVal = 0; public float blueFront2 = 255; float blueFront2DefaultVal = 0; public float positionxSpotBack = 1000; float positionxSpotBackDefaultVal = 0; public float positionySpotBack = 1000; float positionySpotBackDefaultVal = 0; public float redBack = 255; float redBackDefaultVal = 0; public float greenBack = 255; float greenBackDefaultVal = 0; public float blueBack = 255; float blueBackDefaultVal = 0; public float positionxSpotBack2 = 1000; float positionxSpotBack2DefaultVal = 0; public float positionySpotBack2 = 1000; float positionySpotBack2DefaultVal = 0; public float redBack2 = 255; float redBack2DefaultVal = 0; public float greenBack2 = 255; float greenBack2DefaultVal = 0; public float blueBack2 = 255; float blueBack2DefaultVal = 0; void setup() { size(1000, 800, P3D); noStroke(); fill(255); sphereDetail(60); gui=new ControlP5(this); gui.setAutoDraw(false); controlBox=gui.addControlWindow("Lighting Board",10,10,375,500,JAVA2D,15); controlBox.setUpdateMode(ControlWindow.ECONOMIC); controlBox.setBackground(color(255,40,0)); controlBox.tab("default").setLabel("Follow"); controlBox.tab("SpotFront1"); controlBox.tab("SpotFront2"); controlBox.tab("SpotBack"); controlBox.tab("Cameras"); //SpotFront1 ControlGroup SpotFront1=gui.addGroup("SpotFront1",10,40,230); SpotFront1.moveTo("SpotFront1",controlBox); Slider positionxSpotFront1=gui.addSlider("positionxSpotFront1",0,1000,0,10,10,20,200); positionxSpotFront1.setSliderMode(Slider.FLEXIBLE); positionxSpotFront1.moveTo(SpotFront1); Slider positionySpotFront1=gui.addSlider("positionySpotFront1",0,1000,0,100,10,20,200); positionySpotFront1.setSliderMode(Slider.FLEXIBLE); positionySpotFront1.moveTo(SpotFront1); Slider redFront1=gui.addSlider("redFront1",0,255,0,10,230,20,200); redFront1.setSliderMode(Slider.FLEXIBLE); redFront1.moveTo(SpotFront1); Slider greenFront1=gui.addSlider("greenFront1",0,255,0,100,230,20,200); greenFront1.setSliderMode(Slider.FLEXIBLE); greenFront1.moveTo(SpotFront1); Slider blueFront1=gui.addSlider("blueFront1",0,255,0,190,230,20,200); blueFront1.setSliderMode(Slider.FLEXIBLE); blueFront1.moveTo(SpotFront1); //SpotFront2 ControlGroup SpotFront2=gui.addGroup("SpotFront2",10,40,230); SpotFront2.moveTo("SpotFront2",controlBox); Slider positionxSpotFront2=gui.addSlider("positionxSpotFront2",0,1000,0,10,10,20,200); positionxSpotFront2.setSliderMode(Slider.FLEXIBLE); positionxSpotFront2.moveTo(SpotFront2); Slider positionySpotFront2=gui.addSlider("positionySpotFront2",0,1000,0,100,10,20,200); positionySpotFront2.setSliderMode(Slider.FLEXIBLE); positionySpotFront2.moveTo(SpotFront2); Slider redFront2=gui.addSlider("redFront2",0,255,0,10,230,20,200); redFront2.setSliderMode(Slider.FLEXIBLE); redFront2.moveTo(SpotFront2); Slider greenFront2=gui.addSlider("greenFront2",0,255,0,100,230,20,200); greenFront2.setSliderMode(Slider.FLEXIBLE); greenFront2.moveTo(SpotFront2); Slider blueFront2=gui.addSlider("blueFront2",0,255,0,190,230,20,200); blueFront2.setSliderMode(Slider.FLEXIBLE); blueFront2.moveTo(SpotFront2); //Backlight ControlGroup SpotBack=gui.addGroup("SpotBack",10,40,230); SpotBack.moveTo("SpotBack",controlBox); Slider positionxSpotBack=gui.addSlider("positionxSpotBack",0,1000,0,10,10,20,200); positionxSpotBack.setSliderMode(Slider.FLEXIBLE); positionxSpotBack.moveTo(SpotBack); Slider positionySpotBack=gui.addSlider("positionySpotBack",0,1000,0,100,10,20,200); positionySpotBack.setSliderMode(Slider.FLEXIBLE); positionySpotBack.moveTo(SpotBack); Slider redBack=gui.addSlider("redBack",0,255,0,10,230,20,200); redBack.setSliderMode(Slider.FLEXIBLE); redBack.moveTo(SpotBack); Slider greenBack=gui.addSlider("greenBack",0,255,0,100,230,20,200); greenBack.setSliderMode(Slider.FLEXIBLE); greenBack.moveTo(SpotBack); Slider blueBack=gui.addSlider("blueBack",0,255,0,190,230,20,200); blueBack.setSliderMode(Slider.FLEXIBLE); blueBack.moveTo(SpotBack); // Backlight2 ControlGroup SpotBack2=gui.addGroup("SpotBack2",10,40,230); SpotBack2.moveTo("SpotBack2",controlBox); Slider positionxSpotBack2=gui.addSlider("positionxSpotBack2",0,1000,0,10,10,20,200); positionxSpotBack2.setSliderMode(Slider.FLEXIBLE); positionxSpotBack2.moveTo(SpotBack2); Slider positionySpotBack2=gui.addSlider("positionySpotBack2",0,1000,0,100,10,20,200); positionySpotBack2.setSliderMode(Slider.FLEXIBLE); positionySpotBack2.moveTo(SpotBack2); Slider redBack2=gui.addSlider("redBack2",0,255,0,10,230,20,200); redBack2.setSliderMode(Slider.FLEXIBLE); redBack2.moveTo(SpotBack2); Slider greenBack2=gui.addSlider("greenBack2",0,255,0,100,230,20,200); greenBack2.setSliderMode(Slider.FLEXIBLE); greenBack2.moveTo(SpotBack2); Slider blueBack2=gui.addSlider("blueBack2",0,255,0,190,230,20,200); blueBack2.setSliderMode(Slider.FLEXIBLE); blueBack2.moveTo(SpotBack2); //Follow Spot ControlGroup FollowSpot=gui.addGroup("FollowSpot",10,40,230); FollowSpot.moveTo(controlBox); Slider redFollowSpot=gui.addSlider("redFollowSpot",0,255,0,10,50,20,200); redFollowSpot.setSliderMode(Slider.FLEXIBLE); redFollowSpot.moveTo(controlBox); Slider greenFollowSpot=gui.addSlider("greenFollowSpot",0,255,0,100,50,20,200); greenFollowSpot.setSliderMode(Slider.FLEXIBLE); greenFollowSpot.moveTo(controlBox); Slider blueFollowSpot=gui.addSlider("blueFollowSpot",0,255,0,190,50,20,200); blueFollowSpot.setSliderMode(Slider.FLEXIBLE); blueFollowSpot.moveTo(controlBox); //Cameras ControlGroup Cameras=gui.addGroup("Cameras",10,40,230); Cameras.moveTo("Cameras",controlBox); Slider cameraPan=gui.addSlider("cameraPan",-1000,1000,252,10,10,20,200); cameraPan.setSliderMode(Slider.FLEXIBLE); cameraPan.moveTo(Cameras); Slider cameraTilt=gui.addSlider("cameraTilt",-1000,1000,-115,100,10,20,200); cameraTilt.setSliderMode(Slider.FLEXIBLE); cameraTilt.moveTo(Cameras); Slider cameraZoom=gui.addSlider("cameraZoom",-1000,1000,757,190,10,20,200); cameraZoom.setSliderMode(Slider.FLEXIBLE); cameraZoom.moveTo(Cameras); Slider cameraRx=gui.addSlider("cameraRx",-2,2,-0.01,10,230,20,200); cameraRx.setSliderMode(Slider.FLEXIBLE); cameraRx.moveTo(Cameras); Slider cameraRy=gui.addSlider("cameraRy",-2,2,0.37,100,230,20,200); cameraRy.setSliderMode(Slider.FLEXIBLE); cameraRy.moveTo(Cameras); Slider cameraRz=gui.addSlider("cameraRz",-2,2,-0.2,190,230,20,200); cameraRz.setSliderMode(Slider.FLEXIBLE); cameraRz.moveTo(Cameras); } void draw() { background(0); beginCamera(); camera(cameraPan,cameraTilt,cameraZoom,width,height,0,-1,0,1); rotateX(cameraRx); rotateY(cameraRy); rotateZ(cameraRz); endCamera(); // beginCamera(); // camera(); // rotateX(cameraTilt); // endCamera(); //lights(); // directionalLight(255, 255, 255, 1, 0, 0); // directionalLight(255,255,255,-1,0,0); spotLight(redFollowSpot, greenFollowSpot, blueFollowSpot, mouseX, mouseY, 0, 0, 0, -1, PI, 0); spotLight(redFront1, greenFront1, blueFront1, positionxSpotFront1,positionySpotFront1,0, 0, 0, -1, PI, 0); spotLight(redFront2, greenFront2, blueFront2, positionxSpotFront2,positionySpotFront2,0, 0, 0, -1, PI, 0); spotLight(redBack, greenBack, blueBack, positionxSpotBack,positionySpotBack,-300, 0, 0, 1, PI, 0); spotLight(redBack2, greenBack2, blueBack2, positionxSpotBack2,positionySpotBack2,-300, 0, 0, 1, PI, 0); // pointLight(0,0,255,0,0,0); //dimmer pushMatrix(); fill(255,255,255,dimmer); translate(0,0,-10); box(1000); popMatrix(); pushMatrix(); fill(255,0,0); translate(mouseX,mouseY,0); box(40); popMatrix(); //Hat pushMatrix(); fill(255); translate(500,155,-200); box(110,10,80); popMatrix(); pushMatrix(); fill(255); translate(500,85,-200); box(50,120,50); popMatrix(); //head pushMatrix(); fill(255); translate(500,200,-200); sphere(50); popMatrix(); //Eyes pushMatrix(); fill(0); translate(485,190,-150); sphere(10); popMatrix(); pushMatrix(); fill(0); translate(515,190,-150); sphere(10); popMatrix(); //Nose pushMatrix(); fill(255); translate(500,210,-150); box(10,10,150); rotateX(-1); popMatrix(); //Mouth pushMatrix(); fill(0); translate(500,225,-150); box(40,10,10); popMatrix(); //body pushMatrix(); fill(255); translate(500,250,-210); box(20,50,20); popMatrix(); pushMatrix(); fill(255); translate(500,300,-200); box(50); popMatrix(); pushMatrix(); fill(255); translate(500,350,-200); box(50); popMatrix(); pushMatrix(); fill(255); translate(500,400,-200); box(50); popMatrix(); pushMatrix(); fill(255); translate(500,450,-200); box(50); popMatrix(); //Legs pushMatrix(); fill(255); translate(510,550,-200); box(25,200,50); popMatrix(); pushMatrix(); fill(255); translate(430,535,-200); rotateZ(10); box(25,200,50); popMatrix(); pushMatrix(); fill(255); translate(532,645,-200); box(70,20,50); popMatrix(); pushMatrix(); fill(255); translate(355,610,-200); rotateZ(10); box(70,20,50); popMatrix(); // hand pushMatrix(); fill(255); translate(520,300,-200); rotateZ(.5); box(30); popMatrix(); pushMatrix(); fill(255); translate(550,330,-200); rotateZ(.5); box(50); popMatrix(); pushMatrix(); fill(255); translate(570,340,-200); rotateZ(.5); box(50); popMatrix(); pushMatrix(); fill(255); translate(590,350,-200); rotateZ(.5); box(50); popMatrix(); pushMatrix(); fill(255); translate(590,351,-180); rotateZ(.5); rotateY(.5); box(50); popMatrix(); pushMatrix(); fill(255); translate(610,365,-150); rotateZ(.5); rotateY(.5); box(20,20,150); popMatrix(); pushMatrix(); fill(255); translate(450,310,-200); box(100,50,50); popMatrix(); pushMatrix(); fill(255); translate(350,310,-220); box(150,20,20); popMatrix(); //Buttons pushMatrix(); fill(255); translate(500,310,-150); sphere(10); popMatrix(); pushMatrix(); fill(255); translate(500,340,-150); sphere(10); popMatrix(); pushMatrix(); fill(255); translate(500,370,-150); sphere(10); popMatrix(); fill(0, 51, 102); ambientLight(102, 102, 102); lightSpecular(204, 204, 204); directionalLight(102, 102, 102, 0, 0, -1); specular(255, 255, 255); translate(700, 150, -200); shininess(1.0); sphere(50); pushMatrix(); fill(0, 51, 102); // ambientLight(102, 102, 102); // lightSpecular(204, 204, 204); // directionalLight(102, 102, 102, 0, 0, -1); // specular(255, 255, 255); translate(-200, 1000, 0); // shininess(1.0); sphere(500); popMatrix(); // pushMatrix(); // fill(0, 51, 102); // ambientLight(102, 102, 102); // lightSpecular(204, 204, 204); // directionalLight(102, 102, 102, 0, 0, -1); // specular(255, 255, 255); // translate(positionxSpotFront1, positionySpotFront1, 0); // shininess(1.0); // box(20,20,50); // popMatrix(); } //dimmer // pushMatrix(); // fill(255,255,255,dimmer); // translate(0,0,-10); // rect(0,0,1000,800); // popMatrix(); // pushMatrix(); // fill(255); //translate(sin(a)+500, 15*cos(a)+0,-200); // translate(a,400,-200); // sphere(50); // popMatrix(); // a=a+10;