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

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

?? camera.java

?? 基于java的3d開發庫。對坐java3d的朋友有很大的幫助。
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
        */        normalizingTransformation = new Matrix4x4();        // 1. Translate the "VRP" point to the origin        Vector3D VRP;        Matrix4x4 T1 = new Matrix4x4();        // Warning: near plane clipping        VRP = eyePosition.add(front.multiply(nearPlaneDistance));        //VRP = eyePosition.add(front.multiply(1));        T1.translation(VRP.multiply(-1));        // 2. Rotate the "VRC" coordinate system such as the front axis        //    become the -z axis        Matrix4x4 R1 = new Matrix4x4();        Matrix4x4 R2 = new Matrix4x4();        R1 = getRotation();        R1.invert();        R2.eulerAnglesRotation(Math.toRadians(90), Math.toRadians(-90), 0);        // 3. Translate such that the center of projection is at the origin	;        // 4. Shear such that the center line of the view volume becomes the        //    z axis	;        // 5. Scale such that the view volume becomes the canonical perspective        //    view volume        Matrix4x4 S1 = new Matrix4x4();        Matrix4x4 S2 = new Matrix4x4();        double dx, dy, dz;        // 5.1. Non proportional scaling to adjust the slopes of the piramid        // planes to fix 45 degrees in u and v directions        dx = rightWithScale.length();        dy = upWithScale.length();        S1.scale(dx, dy, 1);        S1.invert();        // 5.2. Proportional scaling to adjust near / far clipping planes        // maintaining the piramid form        dz = nearPlaneDistance;        S2.scale(dz, dz, dz);        S2.invert();        //        normalizingTransformation = S2.multiply(S1.multiply(R2.multiply(R1.multiply(T1))));    }    /**    Given a 2D integer coordinate in viewport space, this method calculates a    proyector ray that emanates from the eye position and passes over the     (u, v) float coordinate in the projection plane. Note that the (u, v)    coordinate correspond to the (x, y) coordinate.    This method is of vital importance to many fundamental algorithms of    visualization (i.e. ray casting, ray tracing, radiosity), object selection    and others (simulation, colision detection, visual debugging, etc.). As it    is important to improve the efficiency of this method, some precalculated    values are stored in the class attributes `_dir`, `upWithScale` and    `rightWithScale`, which values are stored in the `updateVectors`    method, leading to the following precondition:    PRE:      - At least a call to the updateVectors method must be done before calling        this method, and after changing any camera parameter the updateVectors        method must be called again to reflect the changes in this calculation.    /todo this method should be named "generateProjectorRay"    */    public final Ray generateRay(int x, int y)    {        double u, v;        Ray ray;        // 1. Convert integer image coordinates into values in the range [-0.5, 0.5]        u = ((double)x - viewportXSize/2.0) / viewportXSize;        v = ((viewportYSize - (double)y - 1) -  viewportYSize/2.0) / viewportYSize;        // 2. Calculate the ray direction        Vector3D dv;        Vector3D du;        if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            double fovFactor = viewportXSize/viewportYSize;            du = left.multiply(-fovFactor);            dv = up;            du = du.multiply(2*u/orthogonalZoom);            dv = dv.multiply(2*v/orthogonalZoom);            ray = new Ray(eyePosition.add(du.add(dv)), front);            return ray;        }        // Default behavior is to assume planar perspective projection        du = rightWithScale.multiply(u);        dv = upWithScale.multiply(v);        Vector3D dir = dv.add(du).add(_dir);        // 3. Build up and return a ray with origin in the eye position and with calculated direction        ray = new Ray(eyePosition, dir);        return ray;    }    public double getOrthogonalZoom()    {        return orthogonalZoom;    }    public void setOrthogonalZoom(double orthogonalZoom)    {        this.orthogonalZoom = orthogonalZoom;    }    public void setRotation(Matrix4x4 R)    {        up.x = R.M[0][2];        up.y = R.M[1][2];        up.z = R.M[2][2];        up.normalize();        front.x = R.M[0][0];        front.y = R.M[1][0];        front.z = R.M[2][0];        front.normalize();        left.x=R.M[0][1];        left.y=R.M[1][1];        left.z=R.M[2][1];        left.normalize();    }    public Matrix4x4 getRotation()    {        //------------------------------------------------------------        Matrix4x4 R = new Matrix4x4();        R.identity();        R.M[0][0] = front.x; R.M[0][1] = left.x; R.M[0][2] = up.x;        R.M[1][0] = front.y; R.M[1][1] = left.y; R.M[1][2] = up.y;        R.M[2][0] = front.z; R.M[2][1] = left.z; R.M[2][2] = up.z;        return R;    }        /**    Note that projectionMatrix = transformationMatrix*viewVolumeMatrix    */    public Matrix4x4 calculateViewVolumeMatrix()    {        //- Calculate the base projection matrix ----------------------------        double leftDistance, rightDistance, upDistance, downDistance, aspect;        Matrix4x4 P = new Matrix4x4();        aspect = viewportXSize / viewportYSize;         switch ( projectionMode ) {          case Camera.PROJECTION_MODE_ORTHOGONAL:            P.orthogonalProjection(-aspect/orthogonalZoom,                                    aspect/orthogonalZoom,                                   -1/orthogonalZoom, 1/orthogonalZoom,                                   nearPlaneDistance, farPlaneDistance);            break;          case Camera.PROJECTION_MODE_PERSPECTIVE:            upDistance = nearPlaneDistance * Math.tan(Math.toRadians(fov/2));            downDistance = -upDistance;            leftDistance = aspect * downDistance;            rightDistance = aspect * upDistance;            P.frustumProjection(leftDistance, rightDistance,                                downDistance, upDistance,                                nearPlaneDistance, farPlaneDistance);            break;        }        return P;    }    public Matrix4x4 calculateTransformationMatrix()    {        return calculateTransformationMatrix(STEREO_MODE_CENTER);    }    /**    Note that projectionMatrix = transformationMatrix*viewVolumeMatrix    */    public Matrix4x4 calculateTransformationMatrix(int stereoMode)    {        //- Take into account the camera position and orientation ----------        Matrix4x4 R;        Matrix4x4 R1;        Matrix4x4 T1 = new Matrix4x4();        Matrix4x4 R_adic2 = new Matrix4x4();        Matrix4x4 R_adic1 = new Matrix4x4();        Matrix4x4 R2 = new Matrix4x4();        Matrix4x4 Tstereo = new Matrix4x4();        Vector3D pstereo = new Vector3D();        double factor_distancia_entre_ojos = 0.04;        R1 = getRotation();        R1.invert();        T1.translation(-eyePosition.x, -eyePosition.y, -eyePosition.z);        R_adic2.axisRotation(Math.toRadians(90), 0, 0, 1);        R_adic1.axisRotation(Math.toRadians(-90), 1, 0, 0);        R = R_adic1.multiply(R_adic2.multiply(R1.multiply(T1)));        if ( stereoMode == STEREO_MODE_LEFT_EYE ) {            pstereo.x = -R.M[0][0] * factor_distancia_entre_ojos;            pstereo.y = -R.M[0][1] * factor_distancia_entre_ojos;            pstereo.z = -R.M[0][2] * factor_distancia_entre_ojos;            Tstereo.translation(pstereo.x, pstereo.y, pstereo.z);            R = R.multiply(Tstereo);        }        if ( stereoMode == STEREO_MODE_RIGHT_EYE ) {            pstereo.x = R.M[0][0] * factor_distancia_entre_ojos;            pstereo.y = R.M[0][1] * factor_distancia_entre_ojos;            pstereo.z = R.M[0][2] * factor_distancia_entre_ojos;            Tstereo.translation(pstereo.x, pstereo.y, pstereo.z);            R = R.multiply(Tstereo);        }        return R;    }    /**    Note that projectionMatrix = transformationMatrix*viewVolumeMatrix    */    public Matrix4x4 calculateProjectionMatrix(int stereoMode)    {        Matrix4x4 P = calculateViewVolumeMatrix();        Matrix4x4 R = calculateTransformationMatrix(stereoMode);        return P.multiply(R);    }    /**    Provides an object to text report convertion, optimized for human    readability and debugging. Do not use for serialization or persistence    purposes.    */    public String toString()    {        //------------------------------------------------------------        String msg;        msg = "<Camera>:\n";        msg += "  - Name: \"" + getName() + "\"\n";        if ( projectionMode == PROJECTION_MODE_PERSPECTIVE ) {            msg = msg + "  - Camera in PERSPECTIVE projection mode\n";          }          else if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            msg = msg + "  - Camera in PARALEL projection mode\n";            msg = msg + "  - Orthogonal zoom = " + orthogonalZoom + "\n";          }          else {            msg = msg + "  - UNKNOWN Camera projection mode!\n";          }        ;        msg = msg + "  - eyePosition(x, y, z) = " + eyePosition + "\n";        msg = msg + "  - focusedPointPosition(x, y, z) = " + eyePosition.add(front.multiply(focalDistance)) + "\n";        //------------------------------------------------------------        Matrix4x4 R, TP;        double yaw, pitch, roll;        TP = calculateProjectionMatrix(STEREO_MODE_CENTER);        R = getRotation();        yaw = R.obtainEulerYawAngle();        pitch = R.obtainEulerPitchAngle();        roll = R.obtainEulerRollAngle();        msg = msg + "  - Rotation yaw/pitch/roll: <" +            VSDK.formatDouble(yaw) + ", " +            VSDK.formatDouble(pitch) + ", " +            VSDK.formatDouble(roll) + "> RAD (<" +            VSDK.formatDouble(Math.toDegrees(yaw)) + ", " +            VSDK.formatDouble(Math.toDegrees(pitch)) + ", " +            VSDK.formatDouble(Math.toDegrees(roll)) + "> DEG)\n";        msg = msg + "  - Rotation quaternion: " + R.exportToQuaternion() + "\n";        //------------------------------------------------------------        updateVectors();        msg = msg + "  - Reference frame:\n";        msg = msg + "    . Vector UP = " + up + " (length " + VSDK.formatDouble(up.length()) + ")\n";        msg = msg + "    . Vector FRONT = " + front + " (length " + VSDK.formatDouble(front.length()) + ")\n";        msg = msg + "    . Vector LEFT = " + left + " (length " + VSDK.formatDouble(front.length()) + ")\n";        msg = msg + "  - Reference frame with scales:\n";        msg = msg + "    . Vector UP' = " + upWithScale + " (length " + VSDK.formatDouble(upWithScale.length()) + ")\n";        msg = msg + "    . Vector FRONT' = " + _dir + " (length " + VSDK.formatDouble(_dir.length()) + ")\n";        msg = msg + "    . Vector RIGHT' = " + rightWithScale + " (length " + VSDK.formatDouble(rightWithScale.length()) + ")\n";        msg = msg + "  - fov = " + VSDK.formatDouble(fov) + "\n";        msg = msg + "  - nearPlaneDistance = " + VSDK.formatDouble(nearPlaneDistance) + "\n";        msg = msg + "  - farPlaneDistance = " + VSDK.formatDouble(farPlaneDistance) + "\n";        msg = msg + "  - Viewport size in pixels = (" + VSDK.formatDouble(viewportXSize) + ", " + VSDK.formatDouble(viewportYSize) + ")\n";        msg = msg + "  - Transformation * projection matrix:" + TP;        //------------------------------------------------------------        Matrix4x4 P;        double leftDistance, rightDistance, upDistance, downDistance, aspect;        P = new Matrix4x4();        aspect = viewportXSize / viewportYSize;         if ( projectionMode == PROJECTION_MODE_PERSPECTIVE ) {            upDistance = nearPlaneDistance * Math.tan(Math.toRadians(fov/2));            downDistance = -upDistance;            leftDistance = aspect * downDistance;            rightDistance = aspect * upDistance;            P.frustumProjection(leftDistance, rightDistance,                                downDistance, upDistance,                                nearPlaneDistance, farPlaneDistance);            msg = msg + "  - Projection matrix:" + P;          }          else if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            P.orthogonalProjection(-aspect/orthogonalZoom,                                     aspect/orthogonalZoom,                                   -1/orthogonalZoom, 1/orthogonalZoom,                                   nearPlaneDistance, farPlaneDistance);            msg = msg + "  - Projection matrix:" + P;        }        //------------------------------------------------------------        return msg;    }    /**    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 calculateUPlaneAtPixel(int x, int y)    {        // 1. Calculate the angle between the front vector and the plane        updateVectors();        double u = ((double)x - viewportXSize/2.0) / viewportXSize;        return calculateUPlane(u);    }    /**    Returns an outward pointing "horizontal" plane with respect to current    camera (horizontal is left-right direction). Outwards means that the    plane normal points outward the visualization volume / frustum.    Camera visualization limits for u are inside the interval [-0.5, 0.5].    PRE: updateVectors() must be called before this method if camera model    is new or recently changed.    */    public InfinitePlane calculateUPlane(double u)    {        if ( projectionMode == PROJECTION_MODE_ORTHOGONAL ) {            u /= orthogonalZoom;            u *= 2*(viewportXSize/viewportYSize);            Vector3D right = left.multiply(-1);            right.normalize();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧亚一区二区三区| 在线观看免费一区| 美脚の诱脚舐め脚责91| 亚洲影院在线观看| 亚洲精品久久嫩草网站秘色| 伊人开心综合网| 亚洲不卡在线观看| 奇米影视一区二区三区小说| 久久国产精品色婷婷| 国产精品亚洲а∨天堂免在线| 国产成人鲁色资源国产91色综| 不卡视频在线观看| 白白色亚洲国产精品| 成av人片一区二区| 欧美日韩亚洲高清一区二区| 5858s免费视频成人| 精品国产凹凸成av人网站| 久久综合精品国产一区二区三区 | 国内精品不卡在线| 麻豆91免费看| 高清国产一区二区| 99久久精品久久久久久清纯| 欧美特级限制片免费在线观看| 欧美日本一区二区三区四区| 日韩一级免费一区| 欧美国产一区在线| 亚洲一区二区不卡免费| 日韩电影在线一区二区三区| 国产高清不卡一区| 欧美日韩一区小说| 国产女主播一区| 日韩主播视频在线| 成人一区二区在线观看| 欧美三级韩国三级日本三斤| 久久久亚洲午夜电影| 亚洲一区二区美女| 粉嫩av一区二区三区粉嫩| 精品视频资源站| 国产免费成人在线视频| 午夜亚洲福利老司机| 国产成人在线视频网址| 5月丁香婷婷综合| 亚洲免费在线电影| 激情五月激情综合网| 在线观看91视频| 亚洲欧美综合网| 国产麻豆欧美日韩一区| 欧美日韩精品是欧美日韩精品| 欧美激情在线一区二区| 老司机免费视频一区二区| 91成人免费在线视频| 国产午夜精品一区二区三区嫩草| 五月天国产精品| 一本到不卡免费一区二区| 国产欧美一区二区三区在线看蜜臀| 五月天欧美精品| 欧美视频在线观看一区二区| 中国av一区二区三区| 蜜臀91精品一区二区三区| 在线看一区二区| 亚洲图片欧美激情| 国产91色综合久久免费分享| 亚洲精品在线电影| 日本成人中文字幕| 9191久久久久久久久久久| 亚洲国产精品久久一线不卡| 91免费看片在线观看| 国产精品三级电影| 国产寡妇亲子伦一区二区| 久久综合视频网| 精品亚洲国产成人av制服丝袜 | 欧美一区二区三区视频在线| 伊人夜夜躁av伊人久久| 91丨九色porny丨蝌蚪| 国产精品久久久99| www.av精品| 一区二区三区在线视频免费| 在线视频你懂得一区二区三区| 亚洲人成精品久久久久| 91蜜桃网址入口| 一区二区三区电影在线播| 91污片在线观看| 亚洲精品乱码久久久久| 欧美午夜一区二区三区免费大片| 亚洲成人一区在线| 777xxx欧美| 黑人巨大精品欧美一区| 国产亚洲精品精华液| 99久久婷婷国产综合精品| 国产精品美女久久久久aⅴ | caoporn国产精品| 综合在线观看色| 欧美色爱综合网| 日本不卡中文字幕| 久久精品欧美日韩| 成人动漫在线一区| 亚洲人成人一区二区在线观看| 欧美丝袜丝nylons| 久久国产精品第一页| 中文字幕二三区不卡| 欧美亚洲国产一区二区三区| 免费高清视频精品| 国产精品久久久久四虎| 91久久线看在观草草青青| 日韩精品亚洲一区二区三区免费| 久久这里只有精品视频网| 99国产精品国产精品毛片| 午夜精品免费在线| 国产午夜精品理论片a级大结局| 91亚洲精华国产精华精华液| 日韩电影免费在线观看网站| 久久婷婷色综合| 欧美偷拍一区二区| 国产99久久久精品| 丝袜脚交一区二区| 中文字幕一区免费在线观看| 欧美一区二区大片| 91免费看视频| 成人性生交大片免费看视频在线| 亚洲成av人片观看| 国产精品久久久久一区二区三区共 | 久久奇米777| 色成年激情久久综合| 精品一区二区三区香蕉蜜桃| 亚洲综合在线视频| 国产喂奶挤奶一区二区三区| 欧美日韩五月天| 91在线你懂得| 国产成人福利片| 久久成人麻豆午夜电影| 亚洲一级二级在线| 亚洲欧洲另类国产综合| 久久精品欧美一区二区三区麻豆| 欧美一区二区黄| 欧美日免费三级在线| 99re热视频这里只精品| 国产精品一区在线观看乱码| 日本视频一区二区三区| 亚洲一区在线电影| 综合欧美亚洲日本| 中文字幕不卡三区| 国产拍揄自揄精品视频麻豆| 久久综合一区二区| 精品久久五月天| 日韩免费成人网| 精品国产乱码久久久久久浪潮| 91精品在线麻豆| 69堂亚洲精品首页| 欧美日韩久久久| 欧美日本精品一区二区三区| 色欧美88888久久久久久影院| 成人sese在线| 成人一区二区视频| av一区二区不卡| 91麻豆免费在线观看| 91在线视频网址| 一本久久精品一区二区| 色成人在线视频| 欧美欧美午夜aⅴ在线观看| 欧美亚洲日本一区| 欧美一区二区视频在线观看2020 | 一个色妞综合视频在线观看| 亚洲另类春色校园小说| 亚洲欧美日韩中文播放| 伊人开心综合网| 三级亚洲高清视频| 老汉av免费一区二区三区| 国产在线精品一区二区夜色| 国产精品99久| 色综合天天综合网天天狠天天| 色综合天天综合网国产成人综合天 | 成人精品视频一区二区三区| 一本久道久久综合中文字幕| 欧美午夜精品理论片a级按摩| 欧美精品aⅴ在线视频| 精品91自产拍在线观看一区| 欧美国产日产图区| 亚洲午夜视频在线| 蜜臀国产一区二区三区在线播放| 国产美女精品在线| 色老综合老女人久久久| 欧美美女一区二区在线观看| 欧美精品一区二区蜜臀亚洲| 亚洲欧美国产77777| 青青草视频一区| 成人av动漫在线| 欧美一区三区二区| 欧美激情一区二区三区四区| 午夜不卡av免费| 成人免费av网站| 欧美一区二区在线观看| 欧美国产一区视频在线观看| 丝袜美腿亚洲一区| 波多野结衣亚洲| 欧美本精品男人aⅴ天堂| 亚洲天堂a在线| 国产精品资源在线| 91精品国产免费| 有坂深雪av一区二区精品| 国产精品91xxx|