Java Code Examples for processing.opengl.PGraphicsOpenGL#rotate()

The following examples show how to use processing.opengl.PGraphicsOpenGL#rotate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DrawUtils.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
static public void drawImage2(PGraphicsOpenGL g, PImage img, int x, int y, int w, int h) {
    g.pushMatrix();
    g.translate(x, y);
    g.scale(-1, 1, 1);
    g.rotate(PApplet.PI);
    g.image(img, 0, 0, w, h);
    g.popMatrix();
}
 
Example 2
Source File: MultiSimpleCalibrator.java    From PapARt with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void drawCalibration(PGraphicsOpenGL screenGraphics) {
    Papart papart = Papart.getPapart();
    MultiSimpleCalibrator multiCalibrator = papart.multiCalibrator;
    PApplet parent = multiCalibrator.parent;
    PGraphicsOpenGL g = (PGraphicsOpenGL) parent.g;

    if (!multiCalibrator.isActive()) {
        System.out.println("ERROR: cannot calibrate with inactive calibrator.");
        return;
    }

    if (skatolo == null) {
        initGUI(parent, g, multiCalibrator);
    }

    g.clear();

    drawAR(parent, g, multiCalibrator, INVALID_VECTOR);

    drawFrame(parent, g, multiCalibrator);

    // number of valid 
    PVector point = multiCalibrator.screenPoints[multiCalibrator.currentScreenPoint];

    drawProgress(g, multiCalibrator, point);

    if (multiCalibrator.doCalibration) {
        PVector pt = multiCalibrator.screenPoints[multiCalibrator.currentScreenPoint];
        g.pushMatrix();
        g.translate(pt.x, pt.y);
        g.rotate(pt.z);
        drawTarget(g, multiCalibrator);
        drawHints(g, multiCalibrator, pt);
        g.popMatrix();
    }

    if (multiCalibrator.showTouch) {
        drawTouchCalibrated(g, multiCalibrator);
    }

    skatolo.draw(g);
}