Package toxi.geom

Examples of toxi.geom.Matrix4x4.identity()


    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));
        m.identity();
        m.rotateZ(MathUtils.HALF_PI);
View Full Code Here


        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));
        m.identity();
        m.rotateAroundAxis(new Vec3D(0, 1, 0), MathUtils.HALF_PI);
View Full Code Here

        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

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.