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

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

?? rotator3d.java

?? 一個小公司要求給寫的很簡單的任務(wù)管理系統(tǒng)。
?? JAVA
字號:
/* * @(#)Rotator3D.java	1.18 06/08/24 *  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. *  * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: *  * -Redistribution of source code must retain the above copyright notice, this *  list of conditions and the following disclaimer. *  * -Redistribution in binary form must reproduce the above copyright notice,  *  this list of conditions and the following disclaimer in the documentation *  and/or other materials provided with the distribution. *  * Neither the name of Sun Microsystems, Inc. or the names of contributors may  * be used to endorse or promote products derived from this software without  * specific prior written permission. *  * This software is provided "AS IS," without a warranty of any kind. ALL  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,  * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY  * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. *  * You acknowledge that this software is not designed, licensed or intended * for use in the design, construction, operation or maintenance of any * nuclear facility. *//* * @(#)Rotator3D.java	1.18 06/08/24 */package java2d.demos.Colors;import java.awt.*;import java2d.AnimatingSurface;import static java.lang.Math.*;/** * 3D objects with color & lighting translated, rotated and scaled. */public class Rotator3D extends AnimatingSurface {    private Objects3D objs[] = new Objects3D[3];    private static final int[][][] polygons =              {         // Solid cube                 {{5, 1, 15, 13, 21, 23, 15},                {5, 2, 21, 13, 19, 27, 21},               {5, 3, 23, 15, 17, 25, 23},                {5, 4, 19, 13, 15, 17, 19},               {5, 5, 27, 21, 23, 25, 27},               {5, 6, 27, 19, 17, 25, 27}},        // Polygonal faces cube              {{5, 1, 21, 13, 19, 27, 21},               {5, 5, 23, 15, 17, 25, 23},                {4,0,15,14,16,15}, {7,6,16,14,13,12,18,17,16}, {4,0,12,19,18,12},               {4,2,22,21,20,22}, {7,0,24,23,22,20,27,26,24}, {4,2,24,26,25,24},               {4, 3, 15, 13, 23, 15}, {4, 0, 23, 13, 21, 23},                {5, 0, 27, 26, 18, 19, 27}, {5, 4, 25, 17, 18, 26, 25}},         // Octahedron              {{4, 3, 18, 21, 16, 18}, {4, 1, 20, 16, 18, 20},                {4, 1, 18, 21, 16, 18}, {4, 3, 20, 17, 19, 20},                {4, 2, 20, 26, 27, 20}, {5, 3, 26, 18, 16, 27, 26},                {5, 0, 17, 24, 25, 19, 17}, {4, 3, 21, 25, 24, 21},                {4, 4, 18, 21, 22, 18}, {4, 2, 22, 21, 17, 22},                {4, 5, 20, 23, 16, 20}, {4, 1, 20, 23, 19, 20},                {4, 6, 21, 23, 16, 21}, {4, 4, 21, 23, 19, 21},                {4, 5, 20, 18, 22, 20}, {4, 6, 20, 22, 17, 20}}             };    private static final double[][][] points =            {         // Points for solid cube & polygonal faces cube            {{ 1,  0,  0}, {-1,  0,  0}, { 0,  1,  0}, { 0, -1,  0}, { 0,  0,  1},              { 0,  0, -1}, { 1,  0,  0}, {-1,  0,  0}, { 0,  1,  0}, { 0, -1,  0},              { 0,  0,  1}, { 0,  0, -1}, { 1,  1,  0}, { 1,  1,  1}, { 0,  1,  1},              {-1,  1,  1}, {-1,  1,  0}, {-1,  1, -1}, { 0,  1, -1}, { 1,  1, -1},              { 1, -1,  0}, { 1, -1,  1}, { 0, -1,  1}, {-1, -1,  1}, {-1, -1,  0},              {-1, -1, -1}, { 0, -1, -1}, { 1, -1, -1}},        // Points for octahedron            {{0, 0, 1}, {0, 0, -1}, {-0.8165, 0.4714, 0.33333},             {0.8165, -0.4714, -0.33333}, {0.8165, 0.4714, 0.33333},             {-0.8165, -0.4714, -0.33333}, {0, -0.9428, 0.3333},             {0, 0.9428, -0.33333}, {0, 0, 1}, {0, 0, -1},             {-0.8165, 0.4714, 0.33333}, {0.8165, -0.4714, -0.33333},              {0.8165, 0.4714, 0.33333}, {-0.8165, -0.4714, -0.33333},               {0, -0.9428, 0.33333}, {0, 0.9428, -0.33333},               {-1.2247, -0.7071, 1}, {1.2247, 0.7071, -1},              {0, 1.4142, 1}, {0, -1.4142, -1}, {-1.2247, 0.7071, -1},              {1.2247, -0.7071, 1}, {0.61237, 1.06066, 0},              {-0.61237, -1.06066, 0}, {1.2247, 0, 0},              {0.61237, -1.06066, 0}, {-0.61237, 1.06066, 0}, {-1.2247, 0, 0}}           };     private static final int[][][] faces =            {          // Solid cube             {{1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 0}, {1, 5}},         // Polygonal faces cube             {{1, 0}, {1, 1}, {3, 2, 3, 4}, {3, 5, 6, 7}, {2,8,9}, {2,10,11}},         // Octahedron             {{1, 2}, {1, 3}, {2, 4, 5}, {2, 6, 7}, {2, 8, 9},               {2, 10, 11}, {2, 12, 13}, {2, 14, 15}},           };    public Rotator3D() {        setBackground(Color.white);    }    public void reset(int w, int h) {        objs[0] = new Objects3D(polygons[0], points[0], faces[0], w, h);        objs[1] = new Objects3D(polygons[1], points[0], faces[1], w, h);        objs[2] = new Objects3D(polygons[2], points[1], faces[2], w, h);    }    public void step(int w, int h) {        for (Objects3D obj : objs) {            if (obj != null) {                obj.step(w, h);            }        }    }    public void render(int w, int h, Graphics2D g2) {        for (Objects3D obj : objs) {            if (obj != null) {                obj.render(g2);            }        }    }    public static void main(String argv[]) {        createDemoFrame(new Rotator3D());    }/** * 3D Objects : Solid Cube, Cube & Octahedron with polygonal faces. */public class Objects3D {    private final int UP = 0;    private final int DOWN = 1;    private int[][] polygons;    private int npoly;    private double[][] points;    private int npoint;    private int[][] faces;    private int nface;    private int ncolour = 10;    private Color[][] colours = new Color[ncolour][7];    private double[] lightvec = {0, 1, 1};     private double Zeye = 10;    private double angle;    private Matrix3D orient, tmp, tmp2, tmp3;    private int scaleDirection;    private double scale, scaleAmt;    private double ix = 3.0, iy = 3.0;    private double[][] rotPts;    private int[][] scrPts;    private int xx[] = new int[20];    private int yy[] = new int[20];    private double x, y;    private int p, j;    private int colour;    private double bounce, persp;     public Objects3D(int[][] polygons,                      double[][] points,                      int[][] faces,                      int w,                      int h) {        this.polygons = polygons;        this.points = points;        this.faces = faces;        npoly = polygons.length;        npoint = points.length;        nface = faces.length;        x = w * random();        y = h * random();        ix = random() > 0.5 ? ix : -ix;        iy = random() > 0.5 ? iy : -iy;        rotPts = new double[npoint][3];        scrPts = new int[npoint][2];                            for (int i = 0; i < ncolour; i++) {            int x = 255 - (ncolour - i - 1)*100/ncolour;            Color[] c = {                new Color(x,x,x), // white                new Color(x,0,0), // red                new Color(0,x,0), // green                new Color(0,0,x), // blue                new Color(x,x,0), // yellow                new Color(0,x,x), // cyan                new Color(x,0,x)  // magenta            };            colours[i] = c;        }        double len = sqrt(lightvec[0]*lightvec[0] +                           lightvec[1]*lightvec[1] +                           lightvec[2]*lightvec[2]);        lightvec[0] = lightvec[0]/len;        lightvec[1] = lightvec[1]/len;        lightvec[2] = lightvec[2]/len;        double max = 0;        for (int i = 0; i < npoint; i++) {            len = sqrt(points[i][0]*points[i][0] +                        points[i][1]*points[i][1] +                       points[i][2]*points[i][2]);            if (len >max) {                max = len;            }        }           for (int i = 0; i < nface; i++) {            len = sqrt(points[i][0]*points[i][0] +                        points[i][1]*points[i][1] +                       points[i][2]*points[i][2]);            points[i][0] = points[i][0]/len;            points[i][1] = points[i][1]/len;            points[i][2] = points[i][2]/len;        }        orient = new Matrix3D();        tmp    = new Matrix3D();        tmp2   = new Matrix3D();        tmp3   = new Matrix3D();        tmp.Rotation(2,0,PI/50);        CalcScrPts((double) w/3,(double) h/3, 0);        scale = min(w/3/max/1.2, h/3/max/1.2);        scaleAmt = scale;        scale *= random() * 1.5;        scaleDirection = scaleAmt < scale ? DOWN : UP;    }     private Color getColour(int f,int index) {        colour = (int)((rotPts[f][0]*lightvec[0] +                        rotPts[f][1]*lightvec[1] +                        rotPts[f][2]*lightvec[2])  * ncolour);         if (colour < 0) {            colour = 0;        }        if (colour > ncolour-1) {            colour = ncolour-1;        }        return colours[colour][polygons[faces[f][index]][1]];    }          private void CalcScrPts(double x, double y, double z) {        for (p = 0; p < npoint; p++) {            rotPts[p][2] =   points[p][0]*orient.M[2][0]                           + points[p][1]*orient.M[2][1]                           + points[p][2]*orient.M[2][2];            rotPts[p][0] =   points[p][0]*orient.M[0][0]                           + points[p][1]*orient.M[0][1]                           + points[p][2]*orient.M[0][2];            rotPts[p][1] = - points[p][0]*orient.M[1][0]                           - points[p][1]*orient.M[1][1]                           - points[p][2]*orient.M[1][2];        }        for (p = nface; p < npoint; p++) {            rotPts[p][2] += z;            persp = (Zeye - rotPts[p][2])/(scale*Zeye);            scrPts[p][0] = (int)(rotPts[p][0]/persp+x);            scrPts[p][1] = (int)(rotPts[p][1]/persp+y);        }    }    private boolean faceUp(int f) {        return (rotPts[f][0] * rotPts[nface+f][0] +                 rotPts[f][1] * rotPts[nface+f][1] +                 rotPts[f][2] *(rotPts[nface+f][2]-Zeye) < 0);    }        public void step(int w, int h) {        x += ix;        y += iy;        if (x > w-scale) {            x = w-scale-1;            ix = -w/100 - 1;        }        if (x-scale < 0) {            x = 2+scale;            ix = w/100 + random()*3;        }        if (y > h-scale) {            y = h-scale-2;            iy = -h/100 - 1;        }        if (y-scale < 0) {            y = 2+scale;            iy = h/100 + random()*3;        }        angle += random() * 0.15;        tmp3.Rotation(1, 2, angle);        tmp2.Rotation(1, 0, angle*sqrt(2)/2);        tmp.Rotation(0, 2, angle*PI/4);        orient.M = tmp3.Times(tmp2.Times(tmp.M));        bounce = abs(cos(0.5*(angle)))*2-1;        if (scale > scaleAmt*1.4) {            scaleDirection = DOWN;        }        if (scale < scaleAmt*0.4) {            scaleDirection = UP;        }        if (scaleDirection == UP) {            scale += random();        }        if (scaleDirection == DOWN) {            scale -= random();        }        CalcScrPts(x, y, bounce);    }    public void render(Graphics2D g2) {        for (int f = 0;f < nface; f++) {            if (faceUp(f)) {                for (j = 1;j < faces[f][0]+1; j++) {                    DrawPoly(g2, faces[f][j], getColour(f,j));                }            }        }     }     private void DrawPoly(Graphics2D g2, int poly, Color colour) {        for (int p = 2; p < polygons[poly][0]+2; p++) {            xx[p-2] = scrPts[polygons[poly][p]][0];            yy[p-2] = scrPts[polygons[poly][p]][1];        }        g2.setColor(colour);         g2.fillPolygon(xx,yy,polygons[poly][0]);        g2.setColor(Color.black);         g2.drawPolygon(xx,yy,polygons[poly][0]);    }/**  * A 3D matrix object. */public class Matrix3D {    public double[][] M = { { 1, 0, 0 },                            { 0, 1, 0 },                            { 0, 0, 1 } };    private double[][] tmp = new double[3][3];    private int row, col, k;     public void Rotation(int i, int j, double angle) {        for (row = 0; row < 3; row++) {            for (col = 0; col <3; col++) {                if (row != col) {                     M[row][col] = 0.0;                 } else {                     M[row][col] = 1.0;                 }            }        }        M[i][i] =  cos(angle);        M[j][j] =  cos(angle);        M[i][j] =  sin(angle);        M[j][i] = -sin(angle);    }    public double[][] Times(double[][] N) {        for (row = 0; row < 3; row++) {            for (col = 0; col < 3; col++) {                tmp[row][col] = 0.0;                for (k = 0; k < 3; k++) {                    tmp[row][col] += M[row][k] * N[k][col];                }            }        }        return tmp;    }} // End Matrix3D} // End Objects3D} // End Rotator3D

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一级片在线观看| 欧美亚洲国产一区二区三区va| 国产精品麻豆久久久| 欧美日韩国产天堂| 国产jizzjizz一区二区| 亚洲午夜久久久| 国产精品麻豆一区二区| 日韩一区二区三区在线视频| caoporn国产精品| 久久成人免费电影| 午夜在线成人av| 亚洲精品久久久蜜桃| 国产亚洲一二三区| 欧美大白屁股肥臀xxxxxx| 欧美亚洲一区二区三区四区| 成人av先锋影音| 国产成人福利片| 久久99精品国产.久久久久久| 亚洲影视在线观看| 亚洲欧美日韩综合aⅴ视频| 欧美日韩一区三区四区| 亚洲免费在线电影| 国产精品天美传媒| 欧美一区二区高清| 欧美亚洲一区二区在线观看| av男人天堂一区| 成人免费视频免费观看| 国产精品一二三四五| 麻豆精品视频在线| 日本在线不卡视频一二三区| 亚洲妇熟xx妇色黄| 亚洲第一二三四区| 亚洲高清中文字幕| 亚洲午夜国产一区99re久久| 亚洲老司机在线| 一区二区三区加勒比av| 中文字幕一区二区三区不卡在线| 国产欧美日韩亚州综合| 国产偷国产偷亚洲高清人白洁| 欧美精品一区二区三区在线播放| 精品少妇一区二区三区日产乱码 | 亚洲伦在线观看| 99久久精品国产一区| 亚洲一区二区三区爽爽爽爽爽| 欧美一区二区三区在线看| 香蕉成人伊视频在线观看| 久久久精品人体av艺术| 精品国内片67194| 日韩欧美精品在线| 日韩欧美一级特黄在线播放| 日韩一卡二卡三卡国产欧美| 欧美一级国产精品| 精品国产一区二区三区av性色| 欧美xxxxx裸体时装秀| 精品日韩一区二区三区| 精品国产乱码久久久久久闺蜜| 久久综合av免费| 国产精品二区一区二区aⅴ污介绍| 国产精品国产精品国产专区不片| 综合久久给合久久狠狠狠97色 | 欧美美女一区二区在线观看| 中文字幕一区二区三区在线播放| 亚洲欧美区自拍先锋| 欧美亚洲尤物久久| 精品视频在线免费观看| 一区二区三区蜜桃| 久久先锋影音av鲁色资源| 国产女人aaa级久久久级| 亚洲欧洲精品成人久久奇米网| 亚洲手机成人高清视频| 亚洲自拍偷拍网站| 免费在线观看日韩欧美| 国产精品白丝jk白祙喷水网站| 不卡视频一二三| 欧美艳星brazzers| 精品久久国产字幕高潮| 国产精品美女久久久久久久久| 亚洲一区在线观看免费观看电影高清| 首页欧美精品中文字幕| 精品综合免费视频观看| av电影天堂一区二区在线观看| 欧美综合亚洲图片综合区| 日韩午夜精品电影| 日韩美女精品在线| 日韩激情一二三区| 成人毛片老司机大片| 久久精品亚洲精品国产欧美 | 精品国产精品一区二区夜夜嗨| 中文字幕精品三区| 午夜精品成人在线视频| 高清国产一区二区| 7777精品伊人久久久大香线蕉超级流畅 | 一区二区视频在线看| 伦理电影国产精品| 色系网站成人免费| 久久综合色鬼综合色| 亚洲一区二区欧美| 国产jizzjizz一区二区| 欧美一区二区大片| 亚洲欧美激情视频在线观看一区二区三区 | 欧美日本在线观看| 国产精品黄色在线观看| 捆绑紧缚一区二区三区视频| 91官网在线免费观看| 日本一区二区视频在线观看| 天堂va蜜桃一区二区三区漫画版| 成人av片在线观看| 久久青草国产手机看片福利盒子| 国产免费观看久久| 国产91精品免费| 丁香婷婷综合网| 欧美一级二级三级蜜桃| 亚洲精选视频在线| 成人一级片在线观看| 欧美精品一区二区高清在线观看 | 久久夜色精品一区| 五月天婷婷综合| 91成人免费在线视频| 亚洲国产成人私人影院tom| 激情偷乱视频一区二区三区| 6080yy午夜一二三区久久| 亚洲综合精品自拍| 91片在线免费观看| 亚洲欧洲色图综合| 成人精品电影在线观看| 久久久国产精品麻豆| 国产一区美女在线| 亚洲精品一区二区三区精华液| 日韩福利电影在线观看| 欧美高清www午色夜在线视频| 亚洲国产精品久久一线不卡| 在线免费精品视频| 一区二区在线观看免费视频播放 | 久久青草国产手机看片福利盒子| 精品国偷自产国产一区| 天堂资源在线中文精品| 捆绑调教美女网站视频一区| 欧美三级韩国三级日本三斤| 亚洲精品成人在线| 色偷偷一区二区三区| 亚洲一区二区三区中文字幕| 在线观看不卡一区| 亚洲成人自拍偷拍| 欧美一区二区大片| 激情综合亚洲精品| 久久久另类综合| 成人动漫一区二区| 亚洲日本va午夜在线电影| 色欧美片视频在线观看在线视频| 亚洲欧美日韩一区二区| 色先锋aa成人| 奇米精品一区二区三区在线观看一| 欧美精品欧美精品系列| 美腿丝袜亚洲综合| 国产校园另类小说区| 99re在线视频这里只有精品| 一区av在线播放| 91精品国产91久久久久久一区二区 | 欧美伊人久久大香线蕉综合69| 99re视频这里只有精品| 精品一二线国产| 在线观看av一区二区| 视频一区二区中文字幕| 精品福利二区三区| 成人午夜av电影| 亚洲动漫第一页| 日韩欧美在线影院| 成人成人成人在线视频| 一区二区三国产精华液| 日韩欧美成人一区| 成人18视频日本| 丝袜美腿亚洲综合| 国产日韩欧美精品一区| 日本精品一区二区三区四区的功能| 亚洲地区一二三色| 久久精品日产第一区二区三区高清版 | 国产sm精品调教视频网站| 一区二区三区中文字幕精品精品 | 亚洲第一综合色| 精品成人a区在线观看| 91丨九色丨蝌蚪丨老版| 日本亚洲三级在线| 亚洲欧洲精品一区二区三区| 欧美一区二区三区不卡| 97精品超碰一区二区三区| 免费不卡在线观看| 日本一区二区三区在线不卡| 麻豆久久久久久久| 成人午夜在线视频| 国产日韩精品一区二区三区| 一本色道久久综合亚洲精品按摩| 日本aⅴ亚洲精品中文乱码| 国产精品美女久久久久久久| 欧美一区二区三区四区久久| av一二三不卡影片| 精品一区二区免费看| 亚洲高清免费一级二级三级| 国产精品久久网站| 欧美成人bangbros| 欧美日韩免费观看一区二区三区|