Package javax.vecmath

Examples of javax.vecmath.Vector3f.sub()


        int n = 0;
        for (int i = 0; i < 4; i++) {
          if (jn[i] == null)
            continue;
          n++;
          v.sub((Point3f) jn[i]);
        }
        if (v.length() == 0) {
          v.set(((Point3f)jn[4]));
          doSwitch = false;
        } else {
View Full Code Here


    }
    if (ptA == null || ptB == null)
      return null;

    Vector3f vA = new Vector3f(ptA);
    vA.sub(ptNorP);

    Vector3f vB = new Vector3f(ptB);
    vB.sub(ptNorP);
    if (reverseY)
      vB.scale(-1);
View Full Code Here

    Vector3f vA = new Vector3f(ptA);
    vA.sub(ptNorP);

    Vector3f vB = new Vector3f(ptB);
    vB.sub(ptNorP);
    if (reverseY)
      vB.scale(-1);
    return Quaternion.getQuaternionFrame(vA, vB, null, yBased);
  }
View Full Code Here

    for (int i = atoms.length; --i >= 0;) {
      if (i == centerAtomIndex)
        continue;
      if (v1 == null) {
        v1 = new Vector3f();
        v1.sub(atoms[i], center);
        v1.normalize();
        vTemp.set(v1);
        continue;
      }
      vTemp.sub(atoms[i], center);
View Full Code Here

        if (nAxes[c2] < axesMaxN[c2]) {
          v3.set(a1);
          v3.add(a2);
          v3.scale(0.5f);
          v3.sub(center);
          getAllAxes(v3);
        }

        // look for the axis perpendicular to the A -- 0 -- B plane
View Full Code Here

        }

        // second, look for planes perpendicular to the A -- B line

        v3.set(a2);
        v3.sub(a1);
        v3.normalize();
        nPlanes = getPlane(v3);
        if (nPlanes == axesMaxN[0])
          return nPlanes;
      }
View Full Code Here

        if (isArrow && nVertices != -2)
          isArrow = false;
      } else if (nVertices == 2 && length != Float.MAX_VALUE) {
        Measure.calcAveragePoint(ptList[0], ptList[1], center);
        normal.set(ptList[1]);
        normal.sub(center);
        normal.scale(0.5f / normal.length() * (length == 0 ? 0.01f : length));
        if (length == 0)
          center.set(ptList[0]);
        ptList[0].set(center);
        ptList[1].set(ptList[0]);
View Full Code Here

      for (int iV = mesh.polygonIndexes[i].length; --iV >= 0;) {
        ipt = mesh.polygonIndexes[i][iV];
        if (ipt == iptlast)
          continue;
        iptlast = ipt;
        diff.sub(mesh.vertices[ipt], center);
        diff.scale(f);
        diff.add(center);
        mesh.vertices[ipt].set(diff);
      }
    }
View Full Code Here

    viewer.transformPoint(coord, pt);
    pt.x = x;
    pt.y = y;
    viewer.unTransformPoint(pt, newcoord);
    move.set(newcoord);
    move.sub(coord);
    int klast = -1;
    for (int i = (moveAll ? 0 : iVertex); i < vertexes.length; i++)
      if (moveAll || i == iVertex) {
        int k = vertexes[i];
        if (k == klast)
View Full Code Here

        Vector3f normal = new Vector3f();
        Vector3f vector1 = new Vector3f();
        Vector3f vector2 = new Vector3f();

        vector1.sub(p2, p1);
        vector2.sub(p3, p1);

        normal.cross(vector1, vector2);
        normal.normalize();
        return normal;
    }
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.