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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? camera.java

?? 基于java的3d開發庫。對坐java3d的朋友有很大的幫助。
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
                    // Warning: Why test with the contrary plane?                    clippingPlane = nearPlane;                }                else {                    // Not possible: non implemented case!                        VSDK.reportMessage(this, VSDK.WARNING,                             "clipLineCohenSutherlandPlanes",                             "Unusal ray case, check code and data");                }                if ( clippingPlane != null ) {                    if ( !clippingPlane.doIntersection(testRay) ) {                        VSDK.reportMessage(this, VSDK.WARNING,                             "clipLineCohenSutherlandPlanes",                             "Unusal ray assembly, check code and data");                    }                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t));                    linePasses = true;                }                //--------------------------------------------------                if ( outcodeout == outcode0 ) {                    clippedPoint0.x = clippingMidPoint.x;                    clippedPoint0.y = clippingMidPoint.y;                    clippedPoint0.z = clippingMidPoint.z;                    outcode0 = calculateOutcodeBits(clippedPoint0,                        rightPlane, leftPlane, upPlane,                         downPlane, nearPlane, farPlane);                  }                  else {                    clippedPoint1.x = clippingMidPoint.x;                    clippedPoint1.y = clippingMidPoint.y;                    clippedPoint1.z = clippingMidPoint.z;                    outcode1 = calculateOutcodeBits(clippedPoint1,                        rightPlane, leftPlane, upPlane,                         downPlane, nearPlane, farPlane);                }            }        } while ( !done );        return linePasses;    }    /**    This method implements the Cohen-Sutherland line clipping algorithm with    respect to the view volume defined by current camera. Recieves the two    line endpoints and return true if any part of this line lies inside the    view volume.  In the case the line crosses the view volume, the new    resulting endpoints are calculated and returned.    This algorithm structure follows the one proposed in [FOLE1992].3.12.3,    generalizing it to the 3D case, as noted in [FOLE1992].6.5.3.    The resulting clipped points are in the canonical volume reference, ready    for projection.  If 3D clipped points are needed, they must be premultiplied    by the inverse of the normalizingTransformation.    */    public boolean clipLineCohenSutherlandCanonicVolume(                             Vector3D point0, Vector3D point1,                             Vector3D clippedPoint0, Vector3D clippedPoint1)    {        //- Local variables definition ------------------------------------        int outcode0;                // 6bit containment code for point0        int outcode1;                // 6bit containment code for point1        int outcodeout;              // Selected endpoint code for iteration        Vector3D clippingMidPoint;   // Selected endpoint clipped for iteration        Ray testRay;                 // Ray use for general line/plane clipping        Vector3D dirFromP0ToP1;      // Temporary for testRay construction        double l;                    // Length of dirFromP0ToP1        int planeId;                 // A number from 1 to 6 identifying which                                     // plane intersection is being tested        //- Algorithm initial state ---------------------------------------        Vector3D pp0, pp1;        pp0 = normalizingTransformation.multiply(point0);        pp1 = normalizingTransformation.multiply(point1);        clippedPoint0.x = pp0.x;        clippedPoint0.y = pp0.y;        clippedPoint0.z = pp0.z;        clippedPoint1.x = pp1.x;        clippedPoint1.y = pp1.y;        clippedPoint1.z = pp1.z;        updateVectors();        clippingMidPoint = new Vector3D();        outcode0 = calculateOutcodeBits(pp0);        outcode1 = calculateOutcodeBits(pp1);        //- Main Cohen-Sutherland iteration cycle (incremental clipping) --        boolean linePasses = false; // Algorithm return value        boolean done = false;       // Iteration exit condition        do {            //- Trivial cases: trivial accept and trivial reject ----------            if ( outcode0 == 0x0 && outcode1 == 0x0 ) {                linePasses = true;                done = true;            }            else if ( (outcode0 & outcode1) != 0x0 ) {                linePasses = false;                done = true;            }            //- Iterative cases: clipping with each of the 6 planes -------            else {                //--------------------------------------------------                dirFromP0ToP1 = clippedPoint1.substract(clippedPoint0);                l = dirFromP0ToP1.length();                if ( l < VSDK.EPSILON ) {                    // continue;                    return false;                }                dirFromP0ToP1.x /= l;                dirFromP0ToP1.y /= l;                dirFromP0ToP1.z /= l;                //--------------------------------------------------                if ( outcode0 != 0 ) {                    outcodeout = outcode0;                  }                  else {                    outcodeout = outcode1;                }                testRay = new Ray(clippedPoint0, dirFromP0ToP1);                //--------------------------------------------------                planeId = 0;                if ( (OPCODE_UP & outcodeout) != 0x0 ) {                    planeId = 1; // up plane;                }                else if ( (OPCODE_DOWN & outcodeout) != 0x0 ) {                    planeId = 2; // down plane;                }                else if ( (OPCODE_LEFT & outcodeout) != 0x0 ) {                    planeId = 3; // left plane;                }                else if ( (OPCODE_RIGHT & outcodeout) != 0x0 ) {                    planeId = 4; // right plane;                }                else if ( (OPCODE_NEAR & outcodeout) != 0x0 ) {                    planeId = 5; // near plane                }                else if ( (OPCODE_FAR & outcodeout) != 0x0 ) {                    planeId = 6; // far plane;                }                else {                    // Not possible: non implemented case!                        VSDK.reportMessage(this, VSDK.WARNING,                             "clipLineCohenSutherlandCanonicVolume",                             "Unusal case, check code and data");                }                double de;                de = (outcodeout == outcode1) ? -VSDK.EPSILON: VSDK.EPSILON;                switch ( planeId ) {                  case 1: // up plane                    testRay.t =                           (l * (1 - clippedPoint0.z - clippedPoint0.y)) /                           (clippedPoint1.z - clippedPoint0.z +                            clippedPoint1.y - clippedPoint0.y);                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                  case 2: // down plane                    testRay.t =                           (l * (clippedPoint0.y - clippedPoint0.z +1)) /                           (clippedPoint1.z - clippedPoint0.z -                            clippedPoint1.y + clippedPoint0.y);                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                  case 3: // left plane                    testRay.t =                           (l * (clippedPoint0.x - clippedPoint0.z +1)) /                           (clippedPoint1.z - clippedPoint0.z -                            clippedPoint1.x + clippedPoint0.x);                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                  case 4: // right plane                    testRay.t =                           (l * (1 - clippedPoint0.z - clippedPoint0.x)) /                           (clippedPoint1.z - clippedPoint0.z +                            clippedPoint1.x - clippedPoint0.x);                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                  case 5: // near plane                    // Warning: near plane clipping                    testRay.t = 			( /*(1-nearPlaneDistance)*/ -clippedPoint0.z * l) /                           (clippedPoint1.z - clippedPoint0.z);                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                  case 6: // far plane                    testRay.t =                         (((-fpd()-                             clippedPoint0.z) * l) /                              (clippedPoint1.z - clippedPoint0.z));                    clippingMidPoint = testRay.origin.add(                        testRay.direction.multiply(testRay.t+de));                    linePasses = true;                    break;                }                //--------------------------------------------------                if ( outcodeout == outcode0 ) {                    clippedPoint0.x = clippingMidPoint.x;                    clippedPoint0.y = clippingMidPoint.y;                    clippedPoint0.z = clippingMidPoint.z;                    outcode0 = calculateOutcodeBits(clippedPoint0);                  }                  else {                    clippedPoint1.x = clippingMidPoint.x;                    clippedPoint1.y = clippingMidPoint.y;                    clippedPoint1.z = clippingMidPoint.z;                    outcode1 = calculateOutcodeBits(clippedPoint1);                }            }        } while ( !done );        return linePasses;    }    /**    Given a point `inPoint` in world coordinates, this method calculates a    pixel's  coordinate in viewport space (in the form <u, v, 0>).    Returns true if the pixel lies inside the viewport, false otherwise.    Note that the integer part of the returned `outProjected` point (in    its x and y coordinates) can be used as an input to a putPixel type    image operation for display, and the same coordinate as double, is    usefull as an input for antialiased versions of line rasterizers.    This method is fundamental for visualization operations, where some    examples includes but are not limited to:    - Given two (previously clipped) line endpoints in world space,       projected positions can be used for 2D line drawing for wireframe      and hidden line rendering algorithms (caligraphic phase prior to      2D rasterizing).    - For interaction techniques, 2D feedback over 2D visualization.    - As part of complex interaction techniques involving a 3D point image      in camera viewport, for example to calculate relative movement in 3D      with respect to aparent current view from camera.    TODO: Current implementation is suspicious. It should use a simple    multiplication of point with projection matrix... but this idea is not    working.    */    public boolean projectPoint(Vector3D inPoint, Vector3D outProjected)    {        // 1. Calculate vectors        Vector3D upCopy = null;        Vector3D rightCopy = null;        double fovFactor = 0.0;        double scaleFactor = 0.0;        fovFactor = viewportXSize/viewportYSize;        updateVectors(); // Should be made a prerequisite for efficiency!        // 2. Calculate projection plane        Vector3D p;        Vector3D center;        InfinitePlane viewPlane;        center = new Vector3D(front);        p = getPosition();        center.normalize();        center.multiply(nearPlaneDistance);        center = center.add(p);        viewPlane = new InfinitePlane(front.multiply(-1), center);        // 3. Calculate projected global coordinates XYZ        Vector3D projected;        if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            projected = (viewPlane.projectPoint(inPoint).substract(center)).multiply(orthogonalZoom);        }        else {            // 3.1. Vector calculation for perspective case            upCopy = new Vector3D(up);            rightCopy = new Vector3D(left.multiply(-1));            scaleFactor = 1.0/Math.tan(Math.toRadians(fov/2));            upCopy.normalize();            upCopy = upCopy.multiply(scaleFactor);            rightCopy.normalize();            rightCopy = rightCopy.multiply(scaleFactor).multiply(1/fovFactor);            // 3.2. Calculate projector for perspective case            Ray r;            r = new Ray(p, inPoint.substract(p));            // 3.3. Project point in view plane from perspective eyepoint            if ( !viewPlane.doIntersection(r) ||                 r.direction.length() < VSDK.EPSILON ) {                return false;            }            projected = r.origin.add(r.direction.multiply(r.t)).substract(center);            // 3.4. Clip projected point in viewport            if ( projected.x < -1 || projected.x > 1 ||                 projected.y < -1 || projected.y > 1 ) {                return false;            }        }        // 4. Scale point to viewport        if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            outProjected.x = viewportXSize/2 + (projected.dotProduct(left.multiply(-1)))/(2*fovFactor)*viewportXSize;            outProjected.y = (((projected.dotProduct(up)*-1)+1)/2)*viewportYSize;        }        else {            outProjected.x = (projected.dotProduct(rightCopy)/2+0.5)*viewportXSize;            outProjected.y = (1-(projected.dotProduct(upCopy)/2+0.5))*viewportYSize;        }        outProjected.z = 0.0;        return true;    }    /**    Return 6 outward pointing planes bounding the view volume / frustum    for current camera.    PRE: updateVectors method should be called before calling this method.    */    public InfinitePlane[] getBoundingPlanes()    {        InfinitePlane planes[];        planes = new InfinitePlane[6];        planes[0] = calculateUPlane(-0.5);        planes[1] = calculateUPlane(0.5);        planes[2] = calculateVPlane(-0.5);        planes[3] = calculateVPlane(0.5);        planes[4] = calculateNearPlane();        planes[5] = calculateFarPlane();        return planes;    }}//===========================================================================//= EOF                                                                     =//===========================================================================

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品自拍网站| 极品尤物av久久免费看| 欧美国产一区在线| 久久综合久久鬼色| 久久久亚洲国产美女国产盗摄| 4438成人网| 日韩欧美精品在线视频| 精品国产91乱码一区二区三区| 精品国产成人系列| 日本一区二区三区在线观看| 国产精品久久久久久一区二区三区| 久久久青草青青国产亚洲免观| 久久欧美一区二区| 国产精品国产三级国产a| 亚洲欧美激情视频在线观看一区二区三区| 国产精品福利一区| 亚洲精品高清在线| 日本成人中文字幕在线视频| 国产乱子伦一区二区三区国色天香| 国产麻豆9l精品三级站| 91尤物视频在线观看| 欧美日韩中文字幕一区| 欧美成人三级电影在线| 国产精品成人免费精品自在线观看 | 亚洲伦理在线免费看| 亚洲午夜激情av| 强制捆绑调教一区二区| 国产福利一区二区| 在线观看免费视频综合| 精品黑人一区二区三区久久| 亚洲欧美在线高清| 日韩黄色免费网站| 成人免费三级在线| 欧美一区二区三区小说| 国产精品久久久久久福利一牛影视 | 亚洲精品自拍动漫在线| 日韩激情一区二区| 成人综合婷婷国产精品久久免费| 欧美影视一区在线| 中文av一区特黄| 免费人成精品欧美精品| 成人爽a毛片一区二区免费| 欧美日韩国产一级| 国产亚洲欧美在线| 亚洲第一搞黄网站| 成人国产免费视频| 日韩精品一区二区三区四区视频 | 一区二区理论电影在线观看| 极品美女销魂一区二区三区免费| 在线视频中文字幕一区二区| 久久久综合激的五月天| 日韩激情视频在线观看| 色综合久久久网| 中文字幕av在线一区二区三区| 日本不卡一区二区| 欧美羞羞免费网站| 日韩一区欧美小说| 国产91对白在线观看九色| 日韩视频一区二区三区| 午夜视频一区二区三区| 91老师片黄在线观看| 国产精品欧美久久久久一区二区 | 中文天堂在线一区| 国产又粗又猛又爽又黄91精品| 欧美日本韩国一区二区三区视频| 亚洲欧美综合另类在线卡通| 成人美女视频在线观看18| 亚洲精品一区二区三区蜜桃下载 | 国产亚洲一区二区三区| 蜜桃一区二区三区在线观看| 日韩一区二区高清| 天天色图综合网| 欧美日韩成人高清| 一区二区激情视频| 欧美午夜电影一区| 亚洲午夜视频在线| 欧美日韩精品一二三区| 亚洲午夜电影网| 欧美精品高清视频| 日本美女一区二区三区视频| 欧美一区国产二区| 热久久免费视频| 精品卡一卡二卡三卡四在线| 国产激情91久久精品导航| 国产欧美精品一区| 99免费精品视频| 亚洲香肠在线观看| 欧美一区二区视频在线观看2022| 美女视频一区二区| 久久综合色婷婷| 99精品视频中文字幕| 洋洋av久久久久久久一区| 91精品国产黑色紧身裤美女| 久久精品国产网站| 国产精品午夜免费| 色综合天天视频在线观看| 亚洲1区2区3区视频| 精品国产欧美一区二区| 成人永久免费视频| 亚洲永久精品大片| 亚洲精品在线免费播放| av中文字幕在线不卡| 亚洲国产精品欧美一二99| 精品国产成人在线影院| 91社区在线播放| 久久国产综合精品| 日韩一区欧美一区| 91麻豆精品国产91久久久| 国产精品一区久久久久| 亚洲精品菠萝久久久久久久| 日韩一卡二卡三卡四卡| 99久久国产综合精品麻豆| 天天影视网天天综合色在线播放| 日本一区二区三区在线观看| 欧美欧美欧美欧美| 成人黄色av网站在线| 男人的天堂久久精品| 亚洲色图欧洲色图| 久久久噜噜噜久久人人看| 欧美吻胸吃奶大尺度电影| 成人免费av在线| 久久99国产精品久久99果冻传媒| 尤物视频一区二区| 欧美韩国日本综合| 欧美一级国产精品| 91久久国产最好的精华液| 国产综合久久久久久鬼色| 午夜一区二区三区在线观看| 国产精品免费av| 精品国产乱码久久久久久图片| 欧美丝袜丝交足nylons| eeuss影院一区二区三区| 激情小说欧美图片| 日韩精品免费视频人成| 亚洲黄色免费网站| 中文字幕一区二区5566日韩| 精品久久久久久久久久久院品网 | 精品国产一区二区三区忘忧草| 欧美性一区二区| 在线区一区二视频| 不卡一区二区三区四区| 国产91综合一区在线观看| 激情深爱一区二区| 秋霞av亚洲一区二区三| 日日夜夜一区二区| 亚洲444eee在线观看| 午夜亚洲福利老司机| 午夜精品成人在线视频| 一二三区精品福利视频| 亚洲精品美腿丝袜| 亚洲欧美日韩国产另类专区| 日韩理论片网站| 亚洲三级在线看| 亚洲自拍偷拍网站| 一区二区三区在线免费播放| 一区二区三区四区国产精品| 亚洲最新视频在线观看| 伊人开心综合网| 亚洲成人av一区| 午夜精品一区二区三区电影天堂| 五月激情丁香一区二区三区| 亚洲电影中文字幕在线观看| 日韩高清电影一区| 麻豆精品精品国产自在97香蕉| 日本成人在线不卡视频| 精品亚洲国内自在自线福利| 韩国成人精品a∨在线观看| 国内精品免费**视频| 粉嫩欧美一区二区三区高清影视 | 精品国精品自拍自在线| 久久婷婷国产综合精品青草| 国产视频在线观看一区二区三区 | 中文字幕av资源一区| 亚洲天堂网中文字| 中文字幕国产一区二区| 亚洲精品中文在线| 亚洲成人你懂的| 国产一区二区在线观看视频| www.欧美.com| 欧美高清dvd| 久久久久久久电影| 亚洲嫩草精品久久| 蜜桃视频在线观看一区二区| 国产一区二区伦理片| 99精品国产热久久91蜜凸| 欧美日韩在线三级| 久久久久久久久久久久电影| 亚洲欧美日韩系列| 蜜臀av国产精品久久久久| 成人精品国产一区二区4080| 欧美日韩精品一区二区三区蜜桃| 精品国产乱码久久久久久影片| 国产精品国产三级国产有无不卡 | 97se亚洲国产综合自在线| 欧美三级电影在线观看| 久久久噜噜噜久久中文字幕色伊伊| 一区二区三区在线影院| 激情五月激情综合网| 欧美色中文字幕| 国产精品久久久一本精品 |