亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? intersect.java

?? JAVA3D矩陳的相關(guān)類
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
   * should be allocated by the user.   * @return <code>true</code> if the segment intersects the point,   *  <code>false</code> if the segment does not intersect the object.   */   public static boolean segmentAndPoint( PickSegment segment, Point3d pnt, 					 double dist[] ) {        Point3d start = new Point3d();    Point3d end = new Point3d();    Vector3d direction = new Vector3d();        segment.get(start, end);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;    if((rayAndPoint(pnt, start, direction, dist)==true) && (dist[0] <= 1.0))      return true;        return false;  }  /**   * Return true if point intersects with segment and the distance, from   * the start of segment to the intersection point, is stored in dist[0].   *   * @param segment The segment that is used in intersection test.   * @param pnt The point that is used in intersection test.   * @param dist On return dist[0] contains the distance between segment's start and the point    * intersection, if exist.   * @return true if segment intersects point, else return false.   */   public static boolean segmentAndPoint( PickSegment segment, Point3f pnt, 					 double dist[] ) {        Point3d start = new Point3d();    Point3d end = new Point3d();    Vector3d direction = new Vector3d();        segment.get(start, end);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;    if((rayAndPoint(new Point3d(pnt), start, direction, dist)==true)        && (dist[0] <= 1.0))      return true;        return false;  }  /**   * Determines if the <code>PickPoint</code> and <code>Point3d</code>   * objects intersect.     *   * @param point The PickPoint that is used in the intersection test.   * @param pnt The Point3d that is used in intersection test.   * @return <code>true</code> if the PickPoint and Point3d objects   *  intersect, <code>false</code> if the do not intersect.   */   public static boolean pointAndPoint( PickPoint point, Point3d pnt) {        Point3d location = new Point3d();        point.get(location);    if ((location.x == pnt.x) && (location.y == pnt.y) &&       (location.z == pnt.z))      return true;         return false;  }  /**   * Return true if pnt intersects with point.   *   * @param point The point that is used in intersection test.   * @param pnt The point that is used in intersection test.   * @return true if point intersects pnt, else return false.   */     public static boolean pointAndPoint( PickPoint point, Point3f pnt) {        Point3d location = new Point3d();        point.get(location);        if(((float) location.x == pnt.x) && ((float) location.y == pnt.y)        && ((float) location.z == pnt.z))      return true;        return false;  }    /**   * Determines if the <code>PickRay</code> and Line   * objects intersect.     * The line is defined as <code>coordinates[index]</code> to   * <code>coordinates[index+1]</code>.   *   * @param ray The ray that is used in the intersection test.   * @param coordinates An array holding the line data.   * @param dist On return dist[0] contains the distance between ray's origin and the point of   * intersection, if it exists. The dist array   * should be allocated by the user.   * @return <code>true</code> if the ray intersects the line,   *  <code>false</code> if the ray does not intersect the object.   */   public static boolean rayAndLine(PickRay ray, Point3d coordinates[],                                   int index,  				   double dist[] ) {    Point3d origin = new Point3d();    Vector3d direction = new Vector3d();    if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect11"));           ray.get(origin, direction);    Point3d start = coordinates[index++];    Point3d end = coordinates[index];        return lineAndRay( start, end, origin, direction, dist );      }  /**   * Return true if line intersects with ray and the distance, from   * the origin of ray to the intersection point, is stored in dist[0].   * The line is defined by coordinates[index] to coordinates[index+1]   *   * @param ray The ray that is used in intersection test.   * @param coordinates an array of vertices.   * @param index the vertex index   * @param dist On return dist[0] contains the distance between ray's origin and the point intersection, if   * exist.   * @return true if ray intersects line, else return false.   */   public static boolean rayAndLine(PickRay ray, Point3f coordinates[], int index,  				   double dist[] ) {    Point3d origin = new Point3d();    Vector3d direction = new Vector3d();    if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect11"));           ray.get(origin, direction);    Point3d start = new Point3d(coordinates[index++]);    Point3d end = new Point3d(coordinates[index]);        return lineAndRay( start, end, origin, direction, dist );      }    /**   * Determines if the <code>PickSegment</code> and Line   * objects intersect.   * The line is defined as <code>coordinates[index]</code> to   * <code>coordinates[index+1]</code>.   *   * @param segment The segment that is used in the intersection test.   * @param coordinates An array holding the line data.   * @param dist On return dist[0] contains the distance between segment's origin and the point of   * intersection, if it exists. The dist array   * should be allocated by the user.   * @return <code>true</code> if the segment intersects the line,   *  <code>false</code> if the segment does not intersect the object.   */   public static boolean segmentAndLine(PickSegment segment,                                       Point3d coordinates[],				       int index, double dist[] ) {    Point3d start = new Point3d();    Point3d end = new Point3d();    Vector3d direction = new Vector3d();            if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect13"));           segment.get(start, end);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;        Point3d startpnt = coordinates[index++];    Point3d endpnt = coordinates[index];        if(lineAndRay(startpnt, endpnt, start, direction, dist)==true)      if(dist[0] <= 1.0)	return true;        return false;  }  /**   * Return true if line intersects with segment and the distance, from   * the start of segment to the intersection point, is stored in dist[0].   * The line is defined by coordinates[index] to coordinates[index+1]   *   * @param segment The segment that is used in intersection test.   * @param coordinates an array of vertices.   * @param index the vertex index   * @param dist On return dist[0] contains the distance between segment's start and the point    * intersection, if exist.   * @return true if segment intersects line, else return false.   */   public static boolean segmentAndLine(PickSegment segment, Point3f coordinates[],				       int index, double dist[] ) {    Point3d start = new Point3d();    Point3d end = new Point3d();    Vector3d direction = new Vector3d();            if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect13"));           segment.get(start, end);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;        Point3d startpnt = new Point3d(coordinates[index++]);    Point3d endpnt = new Point3d(coordinates[index]);        if(lineAndRay(startpnt, endpnt, start, direction, dist)==true)      if(dist[0] <= 1.0)	return true;        return false;  }    /**   * Determines if the <code>PickPoint</code> and Line   * objects intersect.   * The line is defined as <code>coordinates[index]</code> to   * <code>coordinates[index+1]</code>.   *   * @param point The point that is used in the intersection test.   * @param coordinates An array holding the line data.   * @return <code>true</code> if the the point intersects the line,   *  <code>false</code> if the the point does not intersect the object.   */   public static boolean pointAndLine(PickPoint point, Point3d coordinates[],				     int index ) {    if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect13"));           double dist[] = new double[1];    Point3d start = coordinates[index++];    Point3d end = coordinates[index];    Point3d location = new Point3d();    Vector3d direction = new Vector3d();        point.get(location);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;    if ((rayAndPoint(location, start, direction, dist)==true) &&        (dist[0] <= 1.0))      return true;        return false;      }  /**   * Return true if line intersects with point.   * The line is defined by coordinates[index] to coordinates[index+1]   *   * @param point The point that is used in intersection test.   * @param coordinates an array of vertices.   * @param index the vertex index   * @return true if point intersects line, else return false.   */     public static boolean pointAndLine(PickPoint point, Point3f coordinates[],				     int index ) {    if((coordinates.length - index) < 2)       throw new RuntimeException(J3dUtilsI18N.getString("Intersect13"));           double dist[] = new double[1];    Point3d start = new Point3d(coordinates[index++]);    Point3d end = new Point3d(coordinates[index]);    Point3d location = new Point3d();    Vector3d direction = new Vector3d();        point.get(location);    direction.x = end.x - start.x;    direction.y = end.y - start.y;    direction.z = end.z - start.z;        if((rayAndPoint(location, start, direction, dist)==true) && (dist[0] <= 1.0))      return true;        return false;      }  /**   *  Return true if point is on the inside of halfspace test. The   *  halfspace is    * partition by the plane of triangle or quad.   * */       private static boolean pointAndPoly( Point3d coordinates[], PickPoint point) {        Vector3d vec0 = new Vector3d(); // Edge vector from point 0 to point 1;    Vector3d vec1 = new Vector3d(); // Edge vector from point 0 to point 2 or 3;    Vector3d pNrm = new Vector3d();    double  absNrmX, absNrmY, absNrmZ, pD = 0.0;    Vector3d tempV3d = new Vector3d();    double pNrmDotrDir = 0.0;         double tempD;    int i, j;    // Compute plane normal.    for(i=0; i<coordinates.length-1;) {      vec0.x = coordinates[i+1].x - coordinates[i].x;      vec0.y = coordinates[i+1].y - coordinates[i].y;      vec0.z = coordinates[i+1].z - coordinates[i++].z;      if(vec0.length() > 0.0)	break;    }            for(j=i; j<coordinates.length-1; j++) {      vec1.x = coordinates[j+1].x - coordinates[j].x;      vec1.y = coordinates[j+1].y - coordinates[j].y;      vec1.z = coordinates[j+1].z - coordinates[j].z;      if(vec1.length() > 0.0)	break;    }        if(j == (coordinates.length-1)) {      // System.out.println("(1) Degenerated polygon.");      return false;  // Degenerated polygon.    }    /*        System.out.println("Ray orgin : " + ray.origin + " dir " + ray.direction);       System.out.println("Triangle/Quad :");       for(i=0; i<coordinates.length; i++)        System.out.println("P" + i + " " + coordinates[i]);       */    pNrm.cross(vec0,vec1);        if(pNrm.length() == 0.0) {      // System.out.println("(2) Degenerated polygon.");      return false;  // Degenerated polygon.    }    // Compute plane D.    tempV3d.set((Tuple3d) coordinates[0]);    pD = pNrm.dot(tempV3d);    Point3d location = new Point3d();    point.get(location);    tempV3d.set((Tuple3d) location);        if((pD - pNrm.dot(tempV3d)) == 0.0 )      return true;        return false;      }  private static boolean lineAndRay(Point3d start, Point3d end, 				    Point3d ori, Vector3d dir, 				    double dist[] ) {        double m00, m01, m10, m11;    double mInv00, mInv01, mInv10, mInv11;    double dmt, t, s, tmp1, tmp2;    Vector3d lDir;    lDir = new Vector3d(end.x - start.x, end.y - start.y,			end.z - start.z);        m00 = lDir.x;    m01 = -dir.x;    m10 = lDir.y;    m11 = -dir.y;    // Get the determinant.    dmt = (m00 * m11) - (m10 * m01);    if(dmt==0.0) // No solution, hence no intersect.      return false;    // Find the inverse.    tmp1 = 1/dmt;    mInv00 = tmp1 * m11;    mInv01 = tmp1 * (-m01);    mInv10 = tmp1 * (-m10);    mInv11 = tmp1 * m00;    tmp1 = ori.x - start.x;    tmp2 = ori.y - start.y;    t = mInv00 * tmp1 + mInv01 * tmp2;    s = mInv10 * tmp1 + mInv11 * tmp2;        if(s<0.0) // Before the origin of ray.      return false;    if((t<0)||(t>1.0)) // Before or after the end points of line.      return false;    tmp1 = ori.z + s * dir.z;    tmp2 = start.z + t * lDir.z;      if((tmp1 < (tmp2 - Double.MIN_VALUE)) || (tmp1 > (tmp2 + Double.MIN_VALUE)))      return false;    dist[0] = s;    return true;  }  private static boolean rayAndPoint( Point3d pnt, Point3d ori,				     Vector3d dir, double dist[] ) {    int flag = 0;    double temp;        if(dir.x != 0.0) {      flag = 0;      dist[0] = (pnt.x - ori.x)/dir.x;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合在线五月| 爽好久久久欧美精品| 欧美日韩国产在线观看| 国产suv一区二区三区88区| 欧美一区二区不卡视频| 精品福利在线导航| 91国产视频在线观看| 国产麻豆成人传媒免费观看| 久久你懂得1024| 高清不卡一区二区| 136国产福利精品导航| 色就色 综合激情| 国产麻豆精品视频| 日韩精品欧美成人高清一区二区| 国产精品的网站| 国产亚洲精品7777| 精品国产乱码久久| 日韩视频在线观看一区二区| 国内精品第一页| 国产精品乱码人人做人人爱| 欧美电影免费观看高清完整版| 欧美日韩三级视频| 色8久久精品久久久久久蜜| 亚洲成人免费影院| 亚洲尤物视频在线| 一区二区三区四区精品在线视频| 欧美欧美午夜aⅴ在线观看| 色综合久久综合网| 色系网站成人免费| 日韩中文字幕av电影| 亚洲一区二区五区| 精品成人一区二区| 精品国产电影一区二区| 日韩女优制服丝袜电影| 成人国产一区二区三区精品| 国产精品77777| 国内精品免费**视频| 老司机免费视频一区二区| 免费欧美在线视频| 久久99这里只有精品| 亚洲嫩草精品久久| 一区二区三区免费看视频| 亚洲精品视频观看| 久久久午夜电影| 欧美日韩综合不卡| 成人综合日日夜夜| 午夜成人在线视频| 日本女人一区二区三区| 亚洲精品写真福利| 免费xxxx性欧美18vr| 国产视频一区在线播放| 国产欧美中文在线| 欧美日韩1区2区| 成人精品一区二区三区中文字幕| 日本强好片久久久久久aaa| 日本欧洲一区二区| 国产综合色在线| 日韩国产欧美在线播放| 日韩国产欧美一区二区三区| 韩国毛片一区二区三区| 国产美女一区二区三区| av中文字幕一区| 欧美日韩综合色| 欧美精品一区二区在线播放 | 91精品综合久久久久久| 成人激情动漫在线观看| 紧缚捆绑精品一区二区| 天天操天天干天天综合网| 日产欧产美韩系列久久99| 国产在线播放一区三区四| 成人国产亚洲欧美成人综合网| 欧美在线啊v一区| 欧美成人a∨高清免费观看| 国产精品欧美综合在线| 亚洲欧美激情在线| 国产精品国产三级国产普通话三级 | 自拍偷拍国产精品| 久久久蜜桃精品| 欧美一区二区在线免费观看| 欧美在线免费播放| 亚洲一区二区视频| 国内精品久久久久影院色| 99国产精品99久久久久久| 日韩三级视频中文字幕| 欧美精品v日韩精品v韩国精品v| 亚洲精品一线二线三线无人区| 69久久99精品久久久久婷婷 | 国产精品日韩成人| 午夜国产精品影院在线观看| 国产成人av一区| 国产一区二区三区在线观看免费视频| 日本欧美在线观看| 91香蕉视频mp4| 久久综合给合久久狠狠狠97色69| 久久夜色精品国产噜噜av | 国产精品久久99| 久久99深爱久久99精品| 韩国三级电影一区二区| 在线观看日韩国产| 欧美国产国产综合| 国产精品视频一二三| 全国精品久久少妇| 精品一区二区在线播放| 欧美日韩视频在线第一区| 国产精品女主播在线观看| 亚洲少妇屁股交4| 亚洲激情一二三区| 午夜影院久久久| 不卡视频在线看| 精品免费日韩av| 中文字幕在线不卡国产视频| 亚洲欧美经典视频| 日产精品久久久久久久性色| 在线亚洲一区二区| 欧美日韩在线三级| 亚洲啪啪综合av一区二区三区| 国产精品一线二线三线| 日韩一卡二卡三卡四卡| 亚洲成a人在线观看| 91黄视频在线| 日韩一区二区精品葵司在线| 国产亚洲成年网址在线观看| 亚洲美女免费在线| 成人一区二区三区视频| 国产亚洲精品资源在线26u| 久久99国内精品| 精品国产污网站| 久久福利视频一区二区| 欧美一区二区三区在线电影| 日韩成人精品在线| 成人黄色a**站在线观看| 久久久久久久电影| 国产一区二区精品久久| xnxx国产精品| 国产风韵犹存在线视精品| 国产亚洲一区二区三区| 国产美女精品人人做人人爽| 国产欧美日韩在线视频| 成人手机电影网| 欧美一区二区三区视频在线观看| 丝袜美腿高跟呻吟高潮一区| 欧美精品粉嫩高潮一区二区| 日本中文在线一区| 精品成人免费观看| 亚洲成人动漫在线免费观看| 欧美亚洲禁片免费| 天天综合色天天| 精品奇米国产一区二区三区| 国产麻豆午夜三级精品| 精品视频在线免费看| 国产农村妇女精品| 波多野结衣亚洲| 精品久久久久久久人人人人传媒| 亚洲精品久久嫩草网站秘色| 欧美日韩在线一区二区| 麻豆91精品视频| 欧美高清在线一区| 狂野欧美性猛交blacked| 日本韩国欧美三级| 天天影视涩香欲综合网 | 亚洲精品美国一| 国产传媒久久文化传媒| 国产精品国产a级| 国产成人精品一区二| 中文字幕一区视频| 国产成人久久精品77777最新版本| 国产精品久久影院| 懂色av一区二区夜夜嗨| 一区二区三区中文在线| 色悠久久久久综合欧美99| 日本成人超碰在线观看| 欧美精品一卡两卡| 国产精品一级黄| 久久久久国产精品麻豆| 久久99久久精品| 亚洲色图欧美偷拍| eeuss鲁片一区二区三区在线看| 亚洲国产日日夜夜| 久久久亚洲精华液精华液精华液| 久久电影网电视剧免费观看| 国产精品免费视频观看| 欧美一区二区网站| 91亚洲资源网| 国产精品久久久久久久久免费相片| 国产一区二区三区免费看| 亚洲六月丁香色婷婷综合久久| 不卡高清视频专区| 日韩国产高清影视| 国产精品国产三级国产aⅴ原创| 高清不卡在线观看| 中文字幕在线视频一区| 日韩视频123| 在线看不卡av| 日韩影院免费视频| 欧美一区二区三区男人的天堂| 成人性生交大片免费看视频在线 | 国产精品免费视频观看| 欧美一区二区三级| 精品在线观看免费| 亚洲在线中文字幕|