Package processing.core

Examples of processing.core.PMatrix3D.mult()


     
      bone.global_matrix = m;

      if (bone.getParent() != null && bone.getParent().global_matrix != null)
        m.preApply(bone.getParent().global_matrix);
      m.mult(new PVector(), bone.getAbsPosition());
     
      if (bone.getChildren().size() > 0)
      {
        for (BvhBone child : bone.getChildren())
        {
View Full Code Here


        }
      }
      else
      {
        m.translate(bone.getEndOffsetX(), bone.getEndOffsetY(), bone.getEndOffsetZ());
        m.mult(new PVector(), bone.getAbsEndPosition());
      }
  }
 
 
  private void _updateFrame()
View Full Code Here

     
      bone.global_matrix = m;

      if (bone.getParent() != null && bone.getParent().global_matrix != null)
        m.preApply(bone.getParent().global_matrix);
      m.mult(new PVector(), bone.getAbsPosition());
     
      if (bone.getChildren().size() > 0)
      {
        for (BvhBone child : bone.getChildren())
        {
View Full Code Here

        }
      }
      else
      {
        m.translate(bone.getEndOffsetX(), bone.getEndOffsetY(), bone.getEndOffsetZ());
        m.mult(new PVector(), bone.getAbsEndPosition());
      }
  }
 
 
  private void _updateFrame()
View Full Code Here

    PMatrix3D m = new PMatrix3D();
    m.apply(matrix);
    if (inverse) {
      m.invert();
    }
    m.mult(new float[] { x, y, 0 }, xyz);

    if (!inverse) {
      xyz[0] += offsetX;
      xyz[1] += offsetY;
    }
View Full Code Here

    PMatrix3D m = new PMatrix3D();
    m.apply(innerMatrix);
    if (inverse) {
      m.invert();
    }
    m.mult(new float[] { x, y, 0 }, xyz);

    if (!inverse) {
      xyz[0] += innerOffsetX;
      xyz[1] += innerOffsetY;
    }
View Full Code Here

  }

  private Coordinate getCoordinateFromInnerPosition(float x, float y) {
    PMatrix3D m = new PMatrix3D();
    float tl[] = new float[3];
    m.mult(new float[] { 0, 0, 0 }, tl);
    float br[] = new float[3];
    m.mult(new float[] { TILE_WIDTH, TILE_HEIGHT, 0 }, br);

    float col = (x - tl[0]) / (br[0] - tl[0]);
    float row = (y - tl[1]) / (br[1] - tl[1]);
View Full Code Here

  private Coordinate getCoordinateFromInnerPosition(float x, float y) {
    PMatrix3D m = new PMatrix3D();
    float tl[] = new float[3];
    m.mult(new float[] { 0, 0, 0 }, tl);
    float br[] = new float[3];
    m.mult(new float[] { TILE_WIDTH, TILE_HEIGHT, 0 }, br);

    float col = (x - tl[0]) / (br[0] - tl[0]);
    float row = (y - tl[1]) / (br[1] - tl[1]);
    Coordinate coord = new Coordinate(row, col, 0);
    return coord;
View Full Code Here

    PMatrix3D m = new PMatrix3D();
    m.apply(matrix);
    if (inverse) {
      m.invert();
    }
    m.mult(new float[] { x, y, 0 }, xy);

    if (!inverse) {
      xy[0] += offsetX;
      xy[1] += offsetY;
    }
View Full Code Here

        float[] factor = new float[]{  ((2 * testpoint.getX())  / applet.width-1,
                         ((2 * testpoint.getY())  / applet.height) -1, //screenH - y?
                        (2 * testpoint.getZ()) -1 ,
                         1,};
        //Matrix mit Vector multiplizieren
        projectionM.mult(factor, result);
       
        //System.out.println("\nResult2: ");
        for (int i = 0; i < result.length; i++) {
          //W auf 1 machen!?
          result[i] /= result[result.length-1]; //normalize so w(4th coord) is 1
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.