Package javax.vecmath

Examples of javax.vecmath.Vector3f.scale()


    vA.sub(ptNorP);

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


        // look for all axes to average position of A and B

        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

      v1.sub(pt2f, pt1f);
      v2.set(v1.x, v1.y, v1.z + 1);
      v2.cross(v2,v1);
      v2.normalize();
      float f = viewer.scaleToScreen((int)pt1f.z, 100);
      v2.scale(f);
      pt1f.set(pt2f);
      pt1f.add(v2);
      pt2f.sub(v2);
      screens[0].set((int)pt1f.x,(int)pt1f.y,(int)pt1f.z);
      g3d.fillSphere(r, screens[0]);
View Full Code Here

            Measure.getNormalFromCenter(randomPoint, points[i], points[j],
                points[k], false, normal) :
            Measure.getNormalFromCenter(points[ptCenter], points[i],
                points[j], points[k], true, normal)
                );
          normal.scale(isCollapsed && !isFlat ? faceCenterOffset
              : 0.001f);
          int nRef = nPoints;
          ptRef.set(points[ptCenter]);
          if (isCollapsed && !isFlat) {
            points[nPoints] = new Point3f(points[ptCenter]);
View Full Code Here

    if (iv != null)
      return iv.shortValue();
    Vector3f newVertexVector = new Vector3f(vertexVectors[v1]);
    vertexVectors[vertexNext] = newVertexVector;
    newVertexVector.add(vertexVectors[v2]);
    newVertexVector.scale(0.5f);
    newVertexVector.normalize();
    htVertex.put(hashKey, new Short(vertexNext));
    return vertexNext++;
  }
}
View Full Code Here

      sb.append("  Ellipsoid ID ").append(ellipsoid.id).append(" modelIndex ")
          .append(ellipsoid.modelIndex).append(" center ").append(
              Escape.escape(ellipsoid.center)).append(" axes");
      for (int i = 0; i < 3; i++) {
        v1.set(ellipsoid.axes[i]);
        v1.scale(ellipsoid.lengths[i]);
        sb.append(" ").append(Escape.escape(v1));
      }
      sb.append(" " + getColorCommand("", ellipsoid.colix));
      if (!ellipsoid.isOn)
        sb.append(" off");
View Full Code Here

      setStatusPicked(-4, ptRet);
    } else {
      Vector3f vNorm = new Vector3f();
      ((IsosurfaceMesh)pickedMesh).getFacePlane(iFace, vNorm);
      // get normal to surface
      vNorm.scale(-1);
      setHeading(ptRet, vNorm, 2);
    }
    return ptRet;
  }
View Full Code Here

    Point3f pt2 = new Point3f(ptRet);
    pt2.add(vNorm);
    Point3f pt2s = new Point3f();
    viewer.transformPoint(pt2, pt2s);
    if (pt2s.y > navPt.y)
      vNorm.scale(-1);
    setHeading(ptRet, vNorm, 0);    
  }

  private void setHeading(Point3f pt, Vector3f vNorm, int nSeconds) {
    // general trick here is to save the original orientation,
View Full Code Here

        Measure.calcNormalizedNormal(ptList[0], ptList[1], ptList[2],
            normal, vAB, vAC);
        center = new Point3f();
        Measure.calcAveragePointN(ptList, nVertices, center);
        dist = (length == Float.MAX_VALUE ? ptList[0].distance(center) : length);
        normal.scale(dist);
        ptList[0].set(center);
        ptList[1].set(center);
        ptList[1].add(normal);
        nVertices = 2;
      } else if (nVertices == 2 && isPerpendicular) {
View Full Code Here

        if (isPlane && length != Float.MAX_VALUE)
          dist /= 2f;
        if (isPlane && isRotated45)
          dist *= 1.4142f;
        Measure.calcXYNormalToLine(ptList[0], ptList[1], normal);
        normal.scale(dist);
        if (isPlane) {
          ptList[2] = new Point3f(center);
          ptList[2].sub(normal);
          pt = new Point3f(center);
          pt.add(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.