// use this function to calibrate force coefficients in real time public void controllers() { cp5 = new ControlP5(this); // slider control for gravity cp5.addSlider("gravY") .setPosition(10, height - 60) .setRange(0.0f, 0.2f) .setSize(200, 10) .setColorCaptionLabel(0) .setCaptionLabel("gravity"); // slider control for drag cp5.addSlider("drag") .setPosition(10, height - 50) .setRange(0.0f, 0.2f) .setSize(200, 10) .setColorCaptionLabel(0); // slider control for attractor strength cp5.addSlider("attStrength") .setPosition(10, height - 35) .setRange(0.0f, 0.2f) .setSize(200, 10) .setColorCaptionLabel(0); // slider control for max wind speed cp5.addSlider("maxWind") .setPosition(10, height - 10) .setRange(0.0f, 0.25f) .setSize(200, 10) .setColorCaptionLabel(0); // background color cp = cp5.addColorPicker("picker") .setPosition(10, 65) .setColorValue(color(0xff40B785, 255)) .hideBar(); }
public void InitSlider() { // Initialize slider plot int posX = 330; int posY = 50; AccSlider = controlP5 .addSlider("Acc_RAW") .setPosition(posX, posY) .setSize(20, 100) .setRange(0, 1023) .setValue(0) .lock() .setColorBackground(c_blue); GyroSlider = controlP5 .addSlider("Gyro_RAW") .setPosition(posX + 50, posY) .setSize(20, 100) .setRange(0, 1023) .setValue(0) .lock() .setColorBackground(c_blue); }
@Override public void setup() { size(2 * w, h + 150); // Camera initiated to capture from device capture = HighGui.captureFromCAM(0); im = CxCore.createImage(w, h, PixelDepth.IPL_DEPTH_8U, ColorModel.BGR); im_thresh = CxCore.createImage(w, h, PixelDepth.IPL_DEPTH_8U, ColorModel.BGR); // Init GUI ControlP5 controlP5 = new ControlP5(this); thresh_slider = controlP5.addSlider("thresh_val", 0, 255, 20, h + 20, 10, 100); r = controlP5.addRadioButton("thresh_type", 80, h + 20); for (int i = 0; i < ThresholdType.values().length; i++) { r.addItem(ThresholdType.values()[i].toString(), i + 1); } r.activate(0); }
public void setup() { size(1024, 768); background(0); frameRate(30); smooth(); drawVectors = false; paused = true; timeline = new Timeline(); sim = new GravitySimulation(); sun = new Star(5000, 25, new PVector(300, 500), new PVector(0, 0), 0, "sun"); planet = new Planet(10, 10, new PVector(500, 500), new PVector(0, 40), "planet"); planet2 = new Planet(50, 10, new PVector(150, 500), new PVector(0, -40), "planet2"); timeline.registerStatefulObject(sun); timeline.registerStatefulObject(planet); timeline.registerStatefulObject(planet2); controlP5 = new ControlP5(this); btnRewind = controlP5.addButton("btnRewind_OnClick", 0, 800, 20, 50, 20); btnRewind.setLabel("Rewind"); btnPlayPause = controlP5.addButton("btnPlayPause_OnClick", 0, 860, 20, 50, 20); btnPlayPause.setLabel("Play"); btnFastForward = controlP5.addButton("btnFastForward_OnClick", 0, 920, 20, 80, 20); btnFastForward.setLabel("Fast Forward"); sliderTimeline = controlP5.addSlider("sliderTimeline_OnClick", 0, 10000, 0, 20, 720, 900, 10); sliderTimeline.setLabel("Timeline"); }
public void setup() { size(800, 600); background(255); // Local variables to set where the components will be int margin = 16; int spacing = 36; int w = 128; int h = 32; // Initialize ControlP5 controlP5 = new ControlP5(this); // Set the color of the labels controlP5.setColorLabel(color(255, 0, 0)); // Add components controlP5.addButton("Clear Screen", 1, margin, spacing, w, h); controlP5.addSlider("Leaf Red", 0, 255, 255, margin, spacing * 2, w, h); controlP5.addSlider("Leaf Green", 0, 255, 64, margin, spacing * 3, w, h); controlP5.addSlider("Leaf Blue", 0, 255, 0, margin, spacing * 4, w, h); controlP5.addSlider("Branch Random", 0, PI, PI / 4, margin, spacing * 5, w, h); controlP5.addSlider("Leaf Random", 0, 32, 16, margin, spacing * 6, w, h); controlP5.addSlider("Leaf Size", 0, 32, 16, margin, spacing * 7, w, h); controlP5.addSlider("Start Size", 0, 128, 64, margin, spacing * 8, w, h); }