Package toxi.geom

Examples of toxi.geom.Triangle3D.toBarycentric()


    public void testBarycentric() {
        Vec3D a = new Vec3D(-100, -100, 0);
        Vec3D c = new Vec3D(100, 0, 0);
        Vec3D b = new Vec3D(-100, 100, 0);
        Triangle3D t = new Triangle3D(a, b, c);
        assertTrue(a.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(a)),
                0.01f));
        assertTrue(b.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(b)),
                0.01f));
        assertTrue(c.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(c)),
                0.01f));
View Full Code Here


        Vec3D c = new Vec3D(100, 0, 0);
        Vec3D b = new Vec3D(-100, 100, 0);
        Triangle3D t = new Triangle3D(a, b, c);
        assertTrue(a.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(a)),
                0.01f));
        assertTrue(b.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(b)),
                0.01f));
        assertTrue(c.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(c)),
                0.01f));
    }
View Full Code Here

        Triangle3D t = new Triangle3D(a, b, c);
        assertTrue(a.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(a)),
                0.01f));
        assertTrue(b.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(b)),
                0.01f));
        assertTrue(c.equalsWithTolerance(t.fromBarycentric(t.toBarycentric(c)),
                0.01f));
    }

    public void testCentroid() {
        Vec3D a = new Vec3D(100, 0, 0);
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.