public void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12) { checkMatrix(2); matrix.apply(n00, n01, n02, n10, n11, n12); }
/** * @param z forward/back translation */ public void translate(float x, float y, float z) { checkMatrix(3); matrix.translate(x, y, z); }
public void scale(float x, float y) { checkMatrix(2); matrix.scale(x, y); }
/** * @param x percentage to scale the object in the x-axis * @param y percentage to scale the object in the y-axis * @param z percentage to scale the object in the z-axis */ public void scale(float x, float y, float z) { checkMatrix(3); matrix.scale(x, y, z); }
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) { checkMatrix(3); matrix.apply(n00, n01, n02, n03, n10, n11, n12, n13, n20, n21, n22, n23, n30, n31, n32, n33); }
/** * @param x percentage to scale the object in the x-axis * @param y percentage to scale the object in the y-axis * @param z percentage to scale the object in the z-axis */ public void scale(float x, float y, float z) { checkMatrix(3); matrix.scale(x, y, z); }
public void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12) { checkMatrix(2); matrix.apply(n00, n01, n02, n10, n11, n12); }
/** * @param tz forward/back translation */ public void translate(float x, float y, float z) { checkMatrix(3); matrix.translate(x, y, z); }
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) { checkMatrix(3); matrix.apply(n00, n01, n02, n03, n10, n11, n12, n13, n20, n21, n22, n23, n30, n31, n32, n33); }
public void scale(float x, float y) { checkMatrix(2); matrix.scale(x, y); }
/** * ( begin auto-generated from PShape_resetMatrix.xml ) * * Replaces the current matrix of a shape with the identity matrix. The * equivalent function in OpenGL is glLoadIdentity(). * * ( end auto-generated ) * @webref pshape:method * @brief Replaces the current matrix of a shape with the identity matrix * @usage web_application * @see PShape#rotate(float) * @see PShape#scale(float) * @see PShape#translate(float, float) */ public void resetMatrix() { checkMatrix(2); matrix.reset(); }
/** * ( begin auto-generated from PShape_resetMatrix.xml ) * * Replaces the current matrix of a shape with the identity matrix. The * equivalent function in OpenGL is glLoadIdentity(). * * ( end auto-generated ) * @webref pshape:method * @brief Replaces the current matrix of a shape with the identity matrix * @usage web_application * @see PShape#rotate(float) * @see PShape#scale(float) * @see PShape#translate(float, float) */ public void resetMatrix() { checkMatrix(2); matrix.reset(); }
/** * ( begin auto-generated from PShape_translate.xml ) * * Specifies an amount to displace the shape. The <b>x</b> parameter * specifies left/right translation, the <b>y</b> parameter specifies * up/down translation, and the <b>z</b> parameter specifies translations * toward/away from the screen. Subsequent calls to the method accumulates * the effect. For example, calling <b>translate(50, 0)</b> and then * <b>translate(20, 0)</b> is the same as <b>translate(70, 0)</b>. This * transformation is applied directly to the shape, it's not refreshed each * time <b>draw()</b> is run. * <br /><br /> * Using this method with the <b>z</b> parameter requires using the P3D * parameter in combination with size. * * ( end auto-generated ) * @webref pshape:method * @usage web_application * @brief Displaces the shape * @param x left/right translation * @param y up/down translation * @see PShape#rotate(float) * @see PShape#scale(float) * @see PShape#resetMatrix() */ public void translate(float x, float y) { checkMatrix(2); matrix.translate(x, y); }
checkMatrix(2); // at least 2... matrix.rotate(angle);
/** * ( begin auto-generated from PShape_scale.xml ) * * Increases or decreases the size of a shape by expanding and contracting * vertices. Shapes always scale from the relative origin of their bounding * box. Scale values are specified as decimal percentages. For example, the * method call <b>scale(2.0)</b> increases the dimension of a shape by * 200%. Subsequent calls to the method multiply the effect. For example, * calling <b>scale(2.0)</b> and then <b>scale(1.5)</b> is the same as * <b>scale(3.0)</b>. This transformation is applied directly to the shape, * it's not refreshed each time <b>draw()</b> is run. * <br /><br /> * Using this method with the <b>z</b> parameter requires using the P3D * parameter in combination with size. * * ( end auto-generated ) * @webref pshape:method * @usage web_application * @brief Increases and decreases the size of a shape * @param s percentate to scale the object * @see PShape#rotate(float) * @see PShape#translate(float, float) * @see PShape#resetMatrix() */ public void scale(float s) { checkMatrix(2); // at least 2... matrix.scale(s); }
/** * ( begin auto-generated from PShape_scale.xml ) * * Increases or decreases the size of a shape by expanding and contracting * vertices. Shapes always scale from the relative origin of their bounding * box. Scale values are specified as decimal percentages. For example, the * method call <b>scale(2.0)</b> increases the dimension of a shape by * 200%. Subsequent calls to the method multiply the effect. For example, * calling <b>scale(2.0)</b> and then <b>scale(1.5)</b> is the same as * <b>scale(3.0)</b>. This transformation is applied directly to the shape, * it's not refreshed each time <b>draw()</b> is run. * <br /><br /> * Using this method with the <b>z</b> parameter requires using the P3D * parameter in combination with size. * * ( end auto-generated ) * @webref pshape:method * @usage web_application * @brief Increases and decreases the size of a shape * @param s percentate to scale the object * @see PShape#rotate(float) * @see PShape#translate(float, float) * @see PShape#resetMatrix() */ public void scale(float s) { checkMatrix(2); // at least 2... matrix.scale(s); }
/** * @nowebref */ public void rotate(float angle, float v0, float v1, float v2) { checkMatrix(3); float norm2 = v0 * v0 + v1 * v1 + v2 * v2; if (Math.abs(norm2 - 1) > EPSILON) { // The rotation vector is not normalized. float norm = PApplet.sqrt(norm2); v0 /= norm; v1 /= norm; v2 /= norm; } matrix.rotate(angle, v0, v1, v2); }
/** * ( begin auto-generated from PShape_translate.xml ) * * Specifies an amount to displace the shape. The <b>x</b> parameter * specifies left/right translation, the <b>y</b> parameter specifies * up/down translation, and the <b>z</b> parameter specifies translations * toward/away from the screen. Subsequent calls to the method accumulates * the effect. For example, calling <b>translate(50, 0)</b> and then * <b>translate(20, 0)</b> is the same as <b>translate(70, 0)</b>. This * transformation is applied directly to the shape, it's not refreshed each * time <b>draw()</b> is run. * <br /><br /> * Using this method with the <b>z</b> parameter requires using the P3D * parameter in combination with size. * * ( end auto-generated ) * @webref pshape:method * @usage web_application * @brief Displaces the shape * @param tx left/right translation * @param ty up/down translation * @see PShape#rotate(float) * @see PShape#scale(float) * @see PShape#resetMatrix() */ public void translate(float x, float y) { checkMatrix(2); matrix.translate(x, y); }
checkMatrix(2); // at least 2... matrix.rotate(angle);
/** * @nowebref */ public void rotate(float angle, float v0, float v1, float v2) { checkMatrix(3); float norm2 = v0 * v0 + v1 * v1 + v2 * v2; if (Math.abs(norm2 - 1) > EPSILON) { // The rotation vector is not normalized. float norm = PApplet.sqrt(norm2); v0 /= norm; v1 /= norm; v2 /= norm; } matrix.rotate(angle, v0, v1, v2); }