Package javax.vecmath

Examples of javax.vecmath.Vector3d.cross()


            int jc = idx[i+2] * 3;
            c.set(coord[jc],coord[jc+1],coord[jc+2]);

            v1.sub(b, a);
            v2.sub(c, a);
            faceNormal.cross(v1, v2);
            if (faceNormal.length()==0) continue;
            faceNormal.normalize();

            // suppose the faces are nearly flat, with small deflection
            // check the scalar product is >0, so each face is the same orientation
View Full Code Here


public class VectorUtils {

  public static Vector3d getProjection(Vector3d p, Vector3d v){
    Vector3d right= new Vector3d();   
    right.cross(p, v);
    Vector3d projection= new Vector3d();
    projection.cross(right, p);
    return projection;
  }
 
View Full Code Here

  public static Vector3d getProjection(Vector3d p, Vector3d v){
    Vector3d right= new Vector3d();   
    right.cross(p, v);
    Vector3d projection= new Vector3d();
    projection.cross(right, p);
    return projection;
  }
 
}
View Full Code Here

        }
        double htScale = options_.getHeightScale();
        Vector3d xVec = new Vector3d(1.0, 0.0, htScale * xdelta);
        Vector3d yVec = new Vector3d(0.0, 1.0, htScale * ydelta);
        Vector3d surfaceNormal = new Vector3d();
        surfaceNormal.cross(xVec, yVec);
        surfaceNormal.normalize();

        return computeColor(c, surfaceNormal);
    }

View Full Code Here

    // hence if cosphi is 0.0 and sinphi is 1 then phi is +90 degrees.
    // Conversely, if cosphi is 0.0 and sinphi is -1 then phi is -90
    // degrees.

    // equ. 5.2c ?
    n.cross(R, S);
    LOG.debug("n  is " + n);

    // equ. 5.28
    sinphi = n.dot(rkj);
    LOG.debug("sinphi is " + sinphi);
View Full Code Here

  if(dv0dv1>0.0 && dv0dv2>0.0) {
      // System.err.println("In intersectTriTri : dv0dv1>0.0 && dv0dv2>0.0");
      return false;
  }
  // compute direction of intersection line.
  tempV3d.cross(n1, n2);

  // compute and index to the largest component of tempV3d.
  max = Math.abs(tempV3d.x);
  index = 0;
  bb = Math.abs(tempV3d.y);
View Full Code Here

    System.err.println("coord1 P" + i + " " + coord1[i]);
    for(i=0; i<coord2.length; i++)
    System.err.println("coord2 P" + i + " " + coord2[i]);
    */

  pNrm.cross(vec0,vec1);

  if(pNrm.length() == 0.0) {
      // System.err.println("(2) Degenerate polygon.");
      return false// Degenerate polygon.
  }
View Full Code Here

/* 2434 */     if (j == coord1.length - 1)
/*      */     {
/* 2436 */       return false;
/*      */     }
/*      */
/* 2446 */     pNrm.cross(vec0, vec1);
/*      */
/* 2448 */     if (pNrm.length() == 0.0D)
/*      */     {
/* 2450 */       return false;
/*      */     }
View Full Code Here

/* 2550 */       if (vec1.length() > 0.0D)
/*      */       {
/*      */         break;
/*      */       }
/*      */     }
/* 2555 */     pNrm.cross(vec0, vec1);
/*      */
/* 2557 */     if ((vec1.length() == 0.0D) || (pNrm.length() == 0.0D))
/*      */     {
/* 2560 */       k = l == 0 ? coordinates.length - 1 : l - 1;
/* 2561 */       isIntersect = intersectLineAndRay(coordinates[l], coordinates[k], origin, direction, pi);
View Full Code Here

/*  6946 */       freeVector3d(n2);
/*  6947 */       freeVector3d(tempV3d);
/*  6948 */       return false;
/*       */     }
/*       */
/*  6951 */     tempV3d.cross(n1, n2);
/*       */
/*  6954 */     double max = Math.abs(tempV3d.x);
/*  6955 */     int index = 0;
/*  6956 */     double bb = Math.abs(tempV3d.y);
/*  6957 */     double cc = Math.abs(tempV3d.z);
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.