Package org.mt4j.util.math

Examples of org.mt4j.util.math.Matrix


   
    this.p3d = ((PGraphics3D)pa.g);
    this.dirty = true;
    this.cameraMat       = new PMatrix3D();
    this.cameraInvMat     = new PMatrix3D();
    this.cameraMatrix     = new Matrix();
    this.cameraInvMatrix   = new Matrix();
  }
View Full Code Here


//    */
  }
 
 
  private void setCachedCamMatrices(){
    Matrix m = this.cameraMatrix;
    Matrix mi = this.cameraInvMatrix;
   
    cameraMat.set(
        m.m00, m.m01, m.m02, m.m03,
        m.m10, m.m11, m.m12, m.m13,
        m.m20, m.m21, m.m22, m.m23,
View Full Code Here

        currentcomp.getAttachedCamera().update();
       
        if (currentcomp.getParent() != null){
          //Applies all transforms up to this components parent
          //because the new camera wiped out all previous transforms
          Matrix m = currentcomp.getParent().getGlobalMatrix();
          PGraphics3D pgraphics3D = (PGraphics3D)graphics;
          pgraphics3D.modelview.apply(
              m.m00, m.m01, m.m02,  m.m03,
              m.m10, m.m11, m.m12,  m.m13,
              m.m20, m.m21, m.m22,  m.m23,
View Full Code Here

   *
   * the Width relative to the world space
   */
  public float getWidthXYGlobal() {
    Vector3D p = this.widthVect.getCopy();
    Matrix m = new Matrix(this.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
View Full Code Here

*
* the height relative to its parent space frame
*/
  public float getHeightXYRelativeToParent() {
    Vector3D p = this.heightVect.getCopy();
    Matrix m = new Matrix(this.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
View Full Code Here

   *
   * the height relative to the world space
   */
  public float getHeightXYGlobal() {
    Vector3D p = this.heightVect.getCopy();
    Matrix m = new Matrix(this.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
View Full Code Here

       
        //Scale vertices of the window
        AbstractShape target = (AbstractShape)ge.getTargetComponent();
        Vertex[] verts = target.getGeometryInfo().getVertices();
        Vector3D newScalingPoint = target.globalToLocal(se.getScalingPoint());
        Matrix m = Matrix.getScalingMatrix(newScalingPoint, se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorZ());
        Vertex.transFormArray(m, verts);
        target.setVertices(verts);

        //Scale vertices of the clip shape
        AbstractShape clip = (AbstractShape)target.getChildClip().getClipShape();
View Full Code Here

   *
   * @return the height xy relative to parent
   */
  private float getHeightXYRelativeToParent() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
//    Vector3D[] v = this.getVectorsRelativeToParent();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
View Full Code Here

   *
   * @return the height xy global
   */
  private float getHeightXYGlobal() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
//    Vector3D[] v = this.getVectorsGlobal();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
View Full Code Here

   * @return the width xy realtive to parent
   */
  private float getWidthXYRealtiveToParent() {
    //This calculates the width aligned/relative to the object
    Vector3D p = this.getWidthXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
    //This calculates the dimension relative to the screen axis (here X-axis)
//    Vector3D[] v = this.getVectorsRelativeToParent();
View Full Code Here

TOP

Related Classes of org.mt4j.util.math.Matrix

Copyright © 2018 www.massapicom. 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.