Package toxi.geom

Examples of toxi.geom.Vec4D.addSelf()


    public Vec3D computeCentroid() {
        Vec4D centroid = new Vec4D();
        for (int i = 0; i < nU; i++) {
            for (int j = 0; j < nV; j++) {
                centroid.addSelf(cps[i][j]);
            }
        }
        return centroid.scaleSelf(1f / (nU * nV)).to3D();
    }

View Full Code Here


        }

        double[] bf = uKnots.basisFunctions(span, u);
        Vec4D cw = new Vec4D();
        for (int i = 0; i <= degree; i++) {
            cw.addSelf(cpoly[(span - degree) + i].getWeighted().scaleSelf(
                    (float) bf[i]));
        }
        return cw.unweightInto(out);
    }
View Full Code Here

        int q = vKnots.getDegree();
        Vec4D[] tmp = new Vec4D[q + 1];
        for (int l = 0; l <= q; l++) {
            Vec4D pw = new Vec4D();
            for (int k = 0; k <= p; k++) {
                pw.addSelf(cpnet.get(uspan - p + k, vspan - q + l)
                        .getWeighted().scaleSelf((float) bfu[k]));
            }
            tmp[l] = pw;
        }
        Vec4D sw = new Vec4D();
View Full Code Here

            }
            tmp[l] = pw;
        }
        Vec4D sw = new Vec4D();
        for (int l = 0; l <= q; l++) {
            sw.addSelf(tmp[l].scaleSelf((float) bfv[l]));
        }
        return sw.unweightInto(out);
    }

    public Vec4D[][][][] surfaceDerivCpts(int d, int r1, int r2, int s1, int s2) {
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.