Package org.earth3d.jearth.math

Examples of org.earth3d.jearth.math.Point3D.normalize()


    stopAutoNavigation();

    /* rotate the direction vector around the upXdirection vector */
   
    Point3D upxdir = up.DotP3D(direction);
    upxdir = upxdir.normalize();

    float matrix[] = new float[16];
    Quaternion quat = new Quaternion();
    quat.createFromAxisAngle((float) upxdir.x, (float) upxdir.y, (float) upxdir.z, angle);
    quat.createMatrix(matrix);
View Full Code Here


    if (isect == new Point3D(0.0, 0.0, 0.0))
      return false;

    Point3D rotateAxes;
    rotateAxes = up.crossproduct(direction);
    rotateAxes = rotateAxes.normalize();

    Point3D dirToIsect;
    dirToIsect = isect.sub(viewer);

    float p, sinP;
View Full Code Here

    a2 = (-b-Math.sqrt(w))/(2*a);
    if (a1<0) a1=a2;
    if (a2<0) a2=a1;
    a=Math.min(a1,a2);
    isect = viewer.add(direction.multiply(a));
    isect = isect.normalize();
    return isect;
  }

  /**
   *
 
View Full Code Here


        float angle = (float) Math.acos(norm_oldmouse.skalarproduct(norm_newmouse));
        vector = vector.normalize();
        Point3D axis = norm_oldmouse.crossproduct(norm_newmouse);
        axis = axis.normalize();

        //     axis = Point3D(0,1,0);
        float matrix[] = new float[16];
        Quaternion quat = new Quaternion();
        quat.createFromAxisAngle((float) axis.x, (float) axis.y, (float) axis.z, len);
View Full Code Here

      v[x] = (float) (direction.x*frustum.clip[0+x*4] + direction.y*frustum.clip[1+x*4] + direction.z*frustum.clip[2+x*4] + frustum.clip[3+x*4]);
    }

    /* find intersection with sphere */
    Point3D pv = new Point3D(v[0], v[1], v[2]);
    pv = pv.normalize();

    Point3D pp = new Point3D(viewer);
    double pvpp = pv.skalarproduct(pp);
    double pvpv = pv.skalarproduct(pv);
    double p = 2*pvpp/pvpv;
 
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.