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

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

?? camera.java

?? 基于java的3d開發庫。對坐java3d的朋友有很大的幫助。
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
            if ( u > 0 ) {                return new InfinitePlane(right, eyePosition.add(right.multiply(u)));            }            else {                return new InfinitePlane(left, eyePosition.add(right.multiply(u)));            }        }        Vector3D du = rightWithScale.multiply(u);        Vector3D f = new Vector3D(front);        Vector3D dir = du.add(_dir);        f.normalize();        double alpha;        dir.normalize();        alpha = Math.acos(f.dotProduct(dir));        if ( u > 0 ) alpha *= -1;        // 2. Calculate the plane normal        Matrix4x4 R = new Matrix4x4();        Vector3D n;        R.axisRotation(alpha, up);        n = R.multiply(du);        n.normalize();        // 3. Build the plane and return        InfinitePlane plane;        plane = new InfinitePlane(n, eyePosition);        return plane;    }    /**    Given `this` camera and the pixel (x, y) in its viewport, this method    calculates an infinite plane that pass by the corresponding proyector    ray origin and by the proyection plane (u, v) point, where (u, v) is    the proyection of pixel (x, y). The plane is perpendicular to the v    direction.    */    public InfinitePlane calculateVPlaneAtPixel(int x, int y)    {        // 1. Calculate the angle between the front vector and the plane        updateVectors();        double v = ((viewportYSize - (double)y - 1) -  viewportYSize/2.0) / viewportYSize;        return calculateVPlane(v);    }    /**    PRE: updateVectors() must be called before this method if camera model    is new or recently changed.    */    public InfinitePlane calculateVPlane(double v)    {        if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            v /= orthogonalZoom;            v *= 2;            Vector3D up2 = new Vector3D(up);            up.normalize();            if ( v > 0 ) {                return new InfinitePlane(up, eyePosition.add(up.multiply(v)));            }            else {                Vector3D down = up.multiply(-1);                return new InfinitePlane(down, eyePosition.add(up.multiply(v)));            }        }        Vector3D dv = upWithScale.multiply(v);        Vector3D f = new Vector3D(front);        Vector3D dir = dv.add(_dir);        f.normalize();        double alpha;        dir.normalize();        alpha = Math.acos(f.dotProduct(dir));        if ( v > 0 ) alpha *= -1;        // 2. Calculate the plane normal        Matrix4x4 R = new Matrix4x4();        Vector3D n;        R.axisRotation(alpha, left);        n = R.multiply(dv);        n.normalize();        // 3. Build the plane and return        InfinitePlane plane;        plane = new InfinitePlane(n, eyePosition);        return plane;    }    /**    PRE: updateVectors() must be called before this method if camera model    is new or recently changed.    WARNING: This is currently considering only the perspective case!    TODO: The paralel projection case!    */    public InfinitePlane calculateNearPlane()    {        InfinitePlane plane;        Vector3D f = new Vector3D(front);        f.normalize();        Vector3D back = f.multiply(-1);        f = f.multiply(nearPlaneDistance);        Vector3D c = eyePosition.add(f);        plane = new InfinitePlane(back, c);        return plane;    }    /**    PRE: updateVectors() must be called before this method if camera model    is new or recently changed.    WARNING: This is currently considering only the perspective case!    TODO: The paralel projection case!    */    public InfinitePlane calculateFarPlane()    {        InfinitePlane plane;        Vector3D f = new Vector3D(front);        f.normalize();        f = f.multiply(farPlaneDistance);        Vector3D c = eyePosition.add(f);        plane = new InfinitePlane(front, c);        return plane;    }    /**    Given a point in "clipping coordinates space", this method calculates    a six bit opcode, as explained in [FOLE1992].6.5.3, suitable for use in the    Cohen-Suterland line clipping algorithm, taking the input point in    homogeneous space, as noted in [FOLE1992].6.5.4.    Note that the "clipping coodinate space" is the result of transforming    world coordinate space with the composed transform-project matrix for    current camera, as returned by the `calculateProjectionMatrix` method.    Note that in VSDK, the clipping space correspond to the frustum for    the minmax cube from <-1, -1, -1> to <1, 1, 1>.    WARNING: This algoritm FAILS when the point to be tested is in the    plane passing through eye position of the camera and paralel to near     plane! In this case, W gets 0 value, and points are not correctly    classified.    @todo: check this method... currently disabled due to non working cases!    */    private int calculateOutcodeBits(Vector4D p)    {        int bits = 0x00;        if ( p.w > 0 ) {            if ( p.x >  p.w ) bits |= OPCODE_RIGHT;            if ( p.x < -p.w ) bits |= OPCODE_LEFT;            if ( p.y >  p.w ) bits |= OPCODE_UP;            if ( p.y < -p.w ) bits |= OPCODE_DOWN;            if ( p.z >  p.w ) bits |= OPCODE_FAR;            if ( p.z < -p.w ) bits |= OPCODE_NEAR;        }        else {            if ( p.x > -p.w ) bits |= OPCODE_RIGHT;            if ( p.x <  p.w ) bits |= OPCODE_LEFT;            if ( p.y > -p.w ) bits |= OPCODE_UP;            if ( p.y <  p.w ) bits |= OPCODE_DOWN;            if ( p.z > -p.w ) bits |= OPCODE_FAR;            if ( p.z <  p.w ) bits |= OPCODE_NEAR;        }        return bits;    }    private double fpd()    {        return (farPlaneDistance - nearPlaneDistance) / nearPlaneDistance;    }    /**    Given a point in "clipping coordinates space", this method calculates    a six bit opcode, as explained in [FOLE1992].6.5.3, suitable for use in the    Cohen-Suterland line clipping algorithm.    Note that in VSDK, the clipping space correspond to the frustum for    the minmax cube from <-1, -1, -1> to <1, 1, 1>.    WARNING: Currently is only implementing the perspective case!    */    private int calculateOutcodeBits(Vector3D p)    {        int bits = 0x00;        if ( p.z + p.x - 1 > 0 ) bits |= OPCODE_RIGHT;        if ( p.z - p.x - 1 > 0 ) bits |= OPCODE_LEFT;        if ( p.z + p.y - 1 > 0 ) bits |= OPCODE_UP;        if ( p.z - p.y - 1 > 0 ) bits |= OPCODE_DOWN;        // Warning: near plane clipping        if ( p.z > 0 ) bits |= OPCODE_NEAR;        if ( p.z < -fpd() ) bits |= OPCODE_FAR;        return bits;    }    /**    Given a point in world space, this method calculates a six bit opcode,    as explained in [FOLE1992].6.5.3, suitable for use in the Cohen-Suterland    line clipping algorithm. The camera view volume should be represented    by its six bounding planes.    */    private int calculateOutcodeBits(Vector3D p,                                     InfinitePlane right, InfinitePlane left,                                     InfinitePlane up, InfinitePlane down,                                     InfinitePlane far, InfinitePlane near)    {        int bits = 0x00;        if ( right.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE ) {            bits |= OPCODE_RIGHT;        }        if ( left.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE ) {            bits |= OPCODE_LEFT;        }        if ( up.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE) {            bits |= OPCODE_UP;        }        if ( down.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE ) {            bits |= OPCODE_DOWN;        }        if ( far.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE ) {            bits |= OPCODE_FAR;        }        if ( near.doContainmentTestHalfSpace(p, VSDK.EPSILON) ==             Geometry.OUTSIDE ) {            bits |= OPCODE_NEAR;        }        return bits;    }    /**    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.    */    public boolean clipLineCohenSutherlandPlanes(                             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        InfinitePlane rightPlane;    // 6 planes defining current camera        InfinitePlane leftPlane;     //   view volume. Note that intersection        InfinitePlane upPlane;       //   tests are done against these planes        InfinitePlane downPlane;     //   using general case non-optimal        InfinitePlane nearPlane;     //   intersections! This sould be        InfinitePlane farPlane;      //   optimized        InfinitePlane clippingPlane; // Selected plane for each iteration        //- Algorithm initial state ---------------------------------------        clippedPoint0.x = point0.x;        clippedPoint0.y = point0.y;        clippedPoint0.z = point0.z;        clippedPoint1.x = point1.x;        clippedPoint1.y = point1.y;        clippedPoint1.z = point1.z;        updateVectors();        clippingMidPoint = new Vector3D();        rightPlane = calculateUPlane(0.5);        leftPlane = calculateUPlane(-0.5);        upPlane = calculateVPlane(0.5);        downPlane = calculateVPlane(-0.5);        nearPlane = calculateNearPlane();        farPlane = calculateFarPlane();        clippingPlane = null;        outcode0 = calculateOutcodeBits(point0, rightPlane, leftPlane,                                       upPlane, downPlane, nearPlane, farPlane);        outcode1 = calculateOutcodeBits(point1, rightPlane, leftPlane,                                      upPlane, downPlane, nearPlane, farPlane);        dirFromP0ToP1 = point1.substract(point0);        dirFromP0ToP1.normalize();        //- 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 {                if ( dirFromP0ToP1.length() < VSDK.EPSILON ) {                    // continue;                    return false;                }                //--------------------------------------------------                if ( outcode0 != 0 ) {                    outcodeout = outcode0;                  }                  else {                    outcodeout = outcode1;                }                testRay = new Ray(point0, dirFromP0ToP1);                //--------------------------------------------------                clippingPlane = null;                if ( (OPCODE_UP & outcodeout) != 0x0 ) {                    clippingPlane = upPlane;                }                else if ( (OPCODE_DOWN & outcodeout) != 0x0 ) {                    clippingPlane = downPlane;                }                else if ( (OPCODE_LEFT & outcodeout) != 0x0 ) {                    clippingPlane = leftPlane;                }                else if ( (OPCODE_RIGHT & outcodeout) != 0x0 ) {                    clippingPlane = rightPlane;                }                else if ( (OPCODE_NEAR & outcodeout) != 0x0 ) {                    // Warning: Why test with the contrary plane?                    clippingPlane = farPlane;                }                else if ( (OPCODE_FAR & outcodeout) != 0x0 ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区一线天视频 | 欧美高清视频一二三区| 亚洲永久免费视频| 欧美日韩视频在线第一区 | 在线欧美日韩国产| 亚洲第四色夜色| 日韩欧美一区在线| 狠狠色丁香久久婷婷综合丁香| 精品国产精品网麻豆系列| 国产激情精品久久久第一区二区| 久久久精品一品道一区| 成人国产视频在线观看| 免费高清不卡av| 欧美xxxxxxxx| 丁香婷婷综合网| 亚洲第一狼人社区| 精品福利一二区| 91原创在线视频| 日本亚洲一区二区| 欧美国产日产图区| 欧美精品在线观看播放| 国产成a人亚洲精品| 一区二区三区免费网站| 精品国产亚洲在线| 99re热这里只有精品视频| 日韩一区精品视频| 国产精品视频一二| 欧美一区二区啪啪| 91一区二区在线| 精品制服美女丁香| 亚洲另类一区二区| 精品国产乱子伦一区| 91久久一区二区| 国产麻豆精品theporn| 亚洲夂夂婷婷色拍ww47| 久久综合色天天久久综合图片| 91色.com| 国产不卡视频一区二区三区| 日韩国产欧美在线视频| 亚洲欧美日韩国产成人精品影院 | 国产一区免费电影| 亚洲一区成人在线| 欧美国产日韩在线观看| 日韩丝袜美女视频| 欧美在线三级电影| 成人激情小说网站| 国产一区二区主播在线| 天天色天天爱天天射综合| 中文一区二区在线观看| 精品成人在线观看| 欧美亚洲综合一区| 成人黄色小视频| 精品在线观看免费| 美腿丝袜亚洲色图| 亚洲一区二区三区四区中文字幕| 中文字幕国产一区| 26uuu国产一区二区三区| 制服视频三区第一页精品| 色美美综合视频| 成人黄页在线观看| 夫妻av一区二区| 韩国v欧美v亚洲v日本v| 蜜臀精品一区二区三区在线观看| 亚洲综合无码一区二区| 亚洲欧美成人一区二区三区| 国产精品乱码久久久久久| 国产精品网站在线| 国产精品污污网站在线观看| 国产亚洲女人久久久久毛片| 精品成人一区二区三区四区| 精品噜噜噜噜久久久久久久久试看| 欧美亚洲国产怡红院影院| 色婷婷激情综合| 色偷偷88欧美精品久久久| 99riav久久精品riav| 色哟哟在线观看一区二区三区| 99久久婷婷国产综合精品| www.色精品| 91色.com| 欧美午夜精品久久久| 欧美日韩视频不卡| 欧美精品久久99久久在免费线| 欧美人牲a欧美精品| 制服.丝袜.亚洲.另类.中文| 日韩一本二本av| 久久青草国产手机看片福利盒子| 久久久久99精品国产片| 中文字幕国产精品一区二区| 国产精品成人一区二区艾草| 亚洲男人电影天堂| 亚洲国产成人porn| 美女网站在线免费欧美精品| 国产美女一区二区三区| 成人的网站免费观看| 91社区在线播放| 欧美人与性动xxxx| 欧美mv日韩mv| 中文字幕中文字幕在线一区 | 国产精品区一区二区三| 亚洲欧美日本韩国| 天天综合网 天天综合色| 韩国成人福利片在线播放| 大胆欧美人体老妇| 欧美性感一类影片在线播放| 欧美v亚洲v综合ⅴ国产v| 国产精品久久久久三级| 亚洲国产精品一区二区www在线| 免费不卡在线视频| av激情成人网| 欧美精品丝袜久久久中文字幕| 日韩精品一区在线观看| 国产精品久久夜| 亚洲成人手机在线| 国产成人午夜精品影院观看视频 | 伊人婷婷欧美激情| 美女视频免费一区| av亚洲精华国产精华精华| 欧美一区二区女人| 亚洲色图在线播放| 久久se这里有精品| 在线视频中文字幕一区二区| 日韩欧美国产午夜精品| 亚洲乱码国产乱码精品精98午夜| 狠狠久久亚洲欧美| 日本韩国欧美一区二区三区| 26uuu色噜噜精品一区二区| 一区二区三区毛片| 懂色av中文一区二区三区| 欧美一区二区精品久久911| 亚洲人精品一区| 国产成人免费高清| 日韩欧美国产一区二区三区| 一区二区三区不卡在线观看 | av网站免费线看精品| 精品国产乱码久久| 日韩精品亚洲一区二区三区免费| 99这里都是精品| 精品久久久久久久久久久久久久久 | 亚洲天堂2014| 国产精品一级片在线观看| 欧美精品粉嫩高潮一区二区| 亚洲欧美日韩国产综合在线| 成人综合婷婷国产精品久久蜜臀 | 亚洲欧美日韩中文字幕一区二区三区| 久久成人免费网站| 欧美狂野另类xxxxoooo| 夜夜嗨av一区二区三区| 成人福利视频在线| 欧美国产日韩精品免费观看| 国产一区二区三区四区在线观看| 777奇米成人网| 一区二区三区日本| 91色九色蝌蚪| 亚洲精品免费电影| 色综合色综合色综合| 亚洲欧美区自拍先锋| eeuss鲁一区二区三区| 中文字幕精品在线不卡| 成人午夜在线播放| 国产精品天干天干在观线| 国产高清精品久久久久| 久久这里只有精品视频网| 久久国产精品72免费观看| 日韩午夜激情av| 老司机免费视频一区二区| 欧美一级一级性生活免费录像| 五月综合激情网| 91精品欧美福利在线观看| 亚洲一区二区三区免费视频| 欧美一a一片一级一片| 亚洲第一成年网| 欧美一个色资源| 精品中文av资源站在线观看| 精品福利av导航| 国产激情一区二区三区四区| 国产日韩精品一区二区三区在线| 成人夜色视频网站在线观看| 中文字幕一区三区| 色综合天天综合在线视频| 一区二区三区美女视频| 欧美老人xxxx18| 久久99久久99| 国产视频不卡一区| 91在线小视频| 视频一区视频二区中文| 亚洲精品在线免费观看视频| 国产精品亚洲人在线观看| 中文字幕一区二区三区不卡在线| 97精品国产97久久久久久久久久久久| 樱桃视频在线观看一区| 91精品国产入口| 国模冰冰炮一区二区| 亚洲三级免费观看| 777色狠狠一区二区三区| 国产一区二区在线视频| 亚洲精品中文字幕乱码三区| 91精品国产综合久久久蜜臀粉嫩| 黄一区二区三区| 亚洲人精品一区| 日韩久久久精品|