Package javax.vecmath

Examples of javax.vecmath.Vector4d


  pDotN  = new double[6];
  mag    = new double[6];
  verts  = new Point3d[planes.length*planes.length];
  nVerts = 0;

  planes[0] = new Vector4d( 1.0, 0.0, 0.0, -1.0 );
  planes[1] = new Vector4d(-1.0, 0.0, 0.0, -1.0 );
  planes[2] = new Vector4d( 0.0, 1.0, 0.0, -1.0 );
  planes[3] = new Vector4d( 0.0,-1.0, 0.0, -1.0 );
  planes[4] = new Vector4d( 0.0, 0.0, 1.0, -1.0 );
  planes[5] = new Vector4d( 0.0, 0.0,-1.0, -1.0 );
  mag[0] = 1.0;
  mag[1] = 1.0;
  mag[2] = 1.0;
  mag[3] = 1.0;
  mag[4] = 1.0;
View Full Code Here


      BoundingPolytope region = (BoundingPolytope) r;
      if( region.planes.length !=planes.length) {
    region.planes = new Vector4d[planes.length];

    for(k=0;k< region.planes.length;k++)
        region.planes[k] = new Vector4d();

    region.mag    = new double[planes.length];
    region.pDotN  = new double[planes.length];
    region.verts  = new Point3d[nVerts];
    region.nVerts = nVerts;
View Full Code Here

  }

  // check if all box points out any frustum plane
  int i = 5;
  while (i>=0){
      Vector4d vc = frustum.clipPlanes[i--];
      if ((( upper.x*vc.x + upper.y*vc.y +
       upper.z*vc.z + vc.w ) < 0.0 ) &&
    (( upper.x*vc.x + lower.y*vc.y +
       upper.z*vc.z + vc.w ) < 0.0 ) &&
    (( upper.x*vc.x + lower.y*vc.y +
View Full Code Here

  this.viewCache = viewCache;

        // Set up the initial plane equations
  int i;
  for (i = 0; i < leftFrustumPlanes.length; i++) {
      leftFrustumPlanes[i] = new Vector4d();
      rightFrustumPlanes[i] = new Vector4d();
  }

  for (i = 0; i < leftFrustumPoints.length; i++) {
      leftFrustumPoints[i] = new Point4d();
      rightFrustumPoints[i] = new Point4d();
View Full Code Here

      for(i=0;i<8;i++){
        verts[i] = new Point3d();
      }

      for(i=0;i<6;i++){
   clipPlanes[i] = new Vector4d( planes[i] );
      }
      computeValues(clipPlanes);
    }
View Full Code Here

      for(i=0;i<8;i++){
        verts[i] = new Point3d();
      }
      for(i=0;i<6;i++){
   clipPlanes[i] = new Vector4d();
      }

    }
View Full Code Here

  ModelClipRetained attr = (ModelClipRetained)
                                originalNode.retained;
  ModelClipRetained rt = (ModelClipRetained) retained;

  Vector4d plane = new Vector4d();

  for (int i=5; i >=0; i--) {
      attr.getPlane(i, plane);
      rt.initPlane(i, plane);
      rt.initEnable(i, attr.getEnable(i));
View Full Code Here

  converged = false;
  firstPoint = true;
  firstInside = false;

  Vector4d pln;

  while( !converged ) {
      if (debug) {
    System.err.println("start: p="+" "+p.x+" "+p.y+" "+p.z);
      }
View Full Code Here

      return true;
  }
    }

    boolean intersect_ptope_abox( BoundingPolytope polyTope, BoundingBox box) {
         Vector4d planes[] = new Vector4d[6];

  if (debug) {
      System.err.println("ptope_abox, box = " + box);
  }
  planes[0] = new Vector4d( -1.0, 0.0, 0.0, box.lower.x);
  planes[1] = new Vector4d1.0, 0.0, 0.0,-box.upper.x);
  planes[2] = new Vector4d0.0,-1.0, 0.0, box.lower.y);
  planes[3] = new Vector4d0.0, 1.0, 0.0,-box.upper.y);
  planes[4] = new Vector4d0.0, 0.0,-1.0, box.lower.z);
  planes[5] = new Vector4d0.0, 0.0, 1.0,-box.upper.z);


  BoundingPolytope pbox = new BoundingPolytope( planes);

  boolean result = intersect_ptope_ptope( polyTope, pbox );
View Full Code Here

    // BoundingPolytope
    // XXXX: remove this once the original method is available (public) in
    // BoundingPolytope
    static boolean pointInPolytope(BoundingPolytope ptope,
           double x, double y, double z ){
  Vector4d p;
  int i = ptope.planes.length - 1;

  while (i >= 0) {
      p = ptope.planes[i--];
      if (( x*p.x + y*p.y + z*p.z + p.w ) > Bounds.EPSILON) {
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector4d

Copyright © 2018 www.massapicom. 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.