From 73891c3ffeb0ba1d38121392ffd535fbfa18d29b Mon Sep 17 00:00:00 2001 From: juw15008 Date: Thu, 10 Dec 2015 03:10:51 -0500 Subject: [PATCH] first_commit --- version_final.pde | 470 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 470 insertions(+) create mode 100644 version_final.pde diff --git a/version_final.pde b/version_final.pde new file mode 100644 index 0000000..07f120f --- /dev/null +++ b/version_final.pde @@ -0,0 +1,470 @@ +import controlP5.*; +import processing.opengl.*; + +// define float lists to store value of x, y, z +FloatList xValue = new FloatList(); +FloatList yValue = new FloatList(); +FloatList zValue = new FloatList(); +float[] xCoordsValue = new float[100]; +float[] yCoordsValue = new float[100]; +float[] zCoordsValue = new float[100]; + +// define Strings to store the input for x, y, z +String xString; +String yString; +String zString; + +// define String to store the iostream of x, y, z +String pointSet = "X-Value Y-Value Z-Value"; + +// define ControlP5 object and other corressponding object +ControlP5 gui; +ControlGroup messageBox; +ControlGroup ajustmentBox; +ControlGroup functionBox; +Button control; +Textarea txt; +Accordion accordion; + +// define other variables + +int messageBoxResult = -1; // hide or show + +// define varibles for adjustmentBox +int aRevert = -1; // revert value for ajustmentBox +float vSidesway = 0.00; +float vShift = 0.00; +float vScaler = 0.00; +float vRotateX = 1.18; +float vRotateY = 0.00; +float vRotateZ = 1.25; +int rColor = 128; +int bColor = 128; +int gColor = 128; + +void setup() { + size(1000, 681, P3D); + noStroke(); + + // create GUI + gui = new ControlP5(this); + gui.setFont(createFont("helvetica", 10)); + //revertAjustment(); + createBox(); + control = gui.addButton("controlBox", 1, 20, 20, 100, 20); + control.setLabel("HIDE"); + +} + +void draw() { + hint(ENABLE_DEPTH_TEST); + pushMatrix(); + if(messageBox.isVisible()) { + controlBackgroundColor(); + } else { + background(0); + fill(255); + } + popMatrix(); + hint(DISABLE_DEPTH_TEST); + + //Drawing the coordinate system and points by the 3D point sets + pushMatrix(); + camera(mouseX, mouseY, (height/2) / tan(PI/5), width/2, height/2, 0, 0, 1, 0); + moveCoords(); + scalerCoords(); + smooth(); + stroke(255); + rotateCoords(); + noFill(); + + for (int i=0; i<500; i += 20){ + stroke(96); + line(i, 0, 0, i, 0, 500); + line(0, i, 0, 0, i, 500); + line(0, 0, i, 0, 500, i); + line(i, 0, 0, i, 500, 0); + line(0, 0, i, 500, 0, i); + line(0, i, 0, 500, i, 0); + } + + strokeWeight(1); + //z-coordinate: red + stroke(255, 0, 0); + line(0, 0, -500, 0, 0, 500); + arrow(0, 0, 500); + //y-coordinate: green + stroke(0, 102, 0); + line(0, -500, 0, 0, 500, 0); + arrow(0, 500, 0); + //x-coordinate: blue + stroke(0, 76, 153); + line(-500, 0, 0, 500, 0, 0); + arrow(500, 0, 0); + + for (int i=0; i