Package toxi.geom

Examples of toxi.geom.Matrix4x4.applyTo()


          myTransform.basis.m01, myTransform.basis.m02, 0,
          myTransform.basis.m10, myTransform.basis.m11,
          myTransform.basis.m12, 0, myTransform.basis.m20,
          myTransform.basis.m21, myTransform.basis.m22, 0, 0, 0, 0, 1);

      p = m.applyTo(p);

      /*
      p = p.rotateX((float) Math.PI);
      p.subSelf(new Vec3D(center.x * scaleBy,
          (center.y * scaleBy), center.z
View Full Code Here


        m.translateSelf(100, 100, 0);
        m.rotateX(MathUtils.HALF_PI);
        m.scaleSelf(10, 10, 10);
        System.out.println(m);
        Vec3D v = new Vec3D(0, 1, 0);
        Vec3D w = m.applyTo(v);
        m = m.getInverted();
        ReadonlyVec3D v2 = m.applyTo(w);
        System.out.println(w);
        System.out.println(v2);
        assertTrue(v2.equalsWithTolerance(v, 0.0001f));
View Full Code Here

        m.scaleSelf(10, 10, 10);
        System.out.println(m);
        Vec3D v = new Vec3D(0, 1, 0);
        Vec3D w = m.applyTo(v);
        m = m.getInverted();
        ReadonlyVec3D v2 = m.applyTo(w);
        System.out.println(w);
        System.out.println(v2);
        assertTrue(v2.equalsWithTolerance(v, 0.0001f));
    }
View Full Code Here

    }

    public void testRotate() {
        Matrix4x4 m = new Matrix4x4();
        m.rotateX(MathUtils.HALF_PI);
        Vec3D v = m.applyTo(new Vec3D(0, 1, 0));
        assertTrue(new Vec3D(0, 0, 1).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateY(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 0, -1).equalsWithTolerance(v, 0.00001f));
View Full Code Here

        m.rotateX(MathUtils.HALF_PI);
        Vec3D v = m.applyTo(new Vec3D(0, 1, 0));
        assertTrue(new Vec3D(0, 0, 1).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateY(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 0, -1).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateZ(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 1, 0).equalsWithTolerance(v, 0.00001f));
View Full Code Here

        m.rotateY(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 0, -1).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateZ(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 1, 0).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateAroundAxis(new Vec3D(0, 1, 0), MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 0, 1).equalsWithTolerance(v, 0.00001f));
View Full Code Here

        m.rotateZ(MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 1, 0).equalsWithTolerance(v, 0.00001f));
        m.identity();
        m.rotateAroundAxis(new Vec3D(0, 1, 0), MathUtils.HALF_PI);
        v = m.applyTo(new Vec3D(1, 0, 0));
        assertTrue(new Vec3D(0, 0, 1).equalsWithTolerance(v, 0.00001f));
    }

    public void testTranslate() {
        Matrix4x4 m = new Matrix4x4();
View Full Code Here

    }

    public void testTranslate() {
        Matrix4x4 m = new Matrix4x4();
        m.translateSelf(100, 100, 100);
        assertEquals(new Vec3D(100, 100, 100), m.applyTo(new Vec3D()));
    }
}
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.