public void rotate(float angle) { intf.app.rotate(angle); }
public void rotate(float angle, float x, float y, float z) { intf.app.rotate(angle, x, y, z); }
/** * Rotate the parent sketch according to the quaternion * * @param q Quaternion */ public void applyQuaternion2Matrix(Quaternion q) { // instead of transforming q into a matrix and applying it... double[] aa = q.getValue(); parent.rotate((float) aa[0], (float) aa[1], (float) aa[2], (float) aa[3]); }
applet.pushMatrix(); applet.translate(pX + pH / 2, pY + pW / 2); applet.rotate(HALF_PI); applet.text(Integer.toString((int) pValue), 0, 0 + labelSize / 2 - 2); applet.popMatrix(); applet.textAlign(PConstants.RIGHT); applet.translate(pX - numberSize / 2, pY); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMax), 0, 0); applet.popMatrix(); applet.textAlign(PConstants.LEFT); applet.translate(pX - numberSize / 2, pY + pW); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMin), 0, 0); applet.popMatrix();
@Override void displayText() { String lFormat = "%d"; if (displayLabel) { applet.fill(labelColor); applet.textSize(labelSize); applet.textAlign(PConstants.CENTER); applet.pushMatrix(); applet.translate(pX + pH / 2, pY + pW / 2); applet.rotate(HALF_PI); applet.text(Integer.toString((int) pValue), 0, 0 + labelSize / 2 - 2); applet.popMatrix(); } if (displayValue) { applet.textSize(numberSize); applet.fill(numbersColor); applet.pushMatrix(); applet.textAlign(PConstants.RIGHT); applet.translate(pX - numberSize / 2, pY); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMax), 0, 0); applet.popMatrix(); applet.pushMatrix(); applet.textAlign(PConstants.LEFT); applet.translate(pX - numberSize / 2, pY + pW); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMin), 0, 0); applet.popMatrix(); } }
applet.pushMatrix(); applet.translate(pX + pH / 2, pY + pW / 2); applet.rotate(HALF_PI); applet.text(Integer.toString((int) pValue), 0, 0 + labelSize / 2 - 2); applet.popMatrix(); applet.textAlign(PConstants.RIGHT); applet.translate(pX - numberSize / 2, pY); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMax), 0, 0); applet.popMatrix(); applet.textAlign(PConstants.LEFT); applet.translate(pX - numberSize / 2, pY + pW); applet.rotate(HALF_PI); applet.text(String.format(lFormat, (int) vMin), 0, 0); applet.popMatrix();