Examples of addSelf()


Examples of toxi.geom.Vec3D.addSelf()

        List<Vec3D> mid = new ArrayList<Vec3D>(2);
        float len = edge.getLength();
        Vec3D a = edge.a.interpolateTo(edge.b, 0.3333f);
        a.addSelf(a.sub(centroid).normalizeTo(ampA * len));
        Vec3D b = edge.a.interpolateTo(edge.b, 0.6666f);
        b.addSelf(b.sub(centroid).normalizeTo(ampB * len));
        mid.add(a);
        mid.add(b);
        return mid;
    }
}
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

            filtered.clear();
            for (Vertex v : selection) {
                final Vec3D laplacian = new Vec3D();
                final List<WEVertex> neighbours = ((WEVertex) v).getNeighbors();
                for (WEVertex n : neighbours) {
                    laplacian.addSelf(n);
                }
                laplacian.scaleSelf(1f / neighbours.size());
                filtered.put(v, laplacian);
            }
            for (Vertex v : filtered.keySet()) {
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

        for (int i = 0, numV = getNumVertices(); i < numV; i++) {
            neighbors = getNeighborsForVertexID(i, neighbors);
            if (neighbors != null && neighbors.size() > 0) {
                Vec3D l = new Vec3D();
                for (Vec3D n : neighbors) {
                    l.addSelf(n);
                }
                l.scaleSelf(1f / neighbors.size());
                lapIndex.put(i, l);
            }
        }
View Full Code Here

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

Examples of toxi.geom.Vec4D.addSelf()

        }

        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

Examples of toxi.geom.Vec4D.addSelf()

        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

Examples of toxi.geom.Vec4D.addSelf()

            }
            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.