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

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

?? rotator3d.java

?? 功能強大的繪圖演示程序
?? JAVA
字號:
/* * @(#)Rotator3D.java	1.15 04/07/26 *  * Copyright (c) 2004 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.15 04/07/26 */package java2d.demos.Colors;import java.awt.*;import java2d.AnimatingSurface;/** * 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 (int i = objs.length; i-- > 0; ) {            if (objs[i] != null) {                objs[i].step(w, h);            }        }    }    public void render(int w, int h, Graphics2D g2) {        for (int i = objs.length; i-- > 0; ) {            if (objs[i] != null) {                objs[i].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 * Math.random();        y = h * Math.random();        ix = Math.random() > 0.5 ? ix : -ix;        iy = Math.random() > 0.5 ? iy : -iy;        rotPts = new double[npoint][3];        scrPts = new int[npoint][2];                            for (int i = 0; i < ncolour; i++) {            // white            colours[i][0]= new Color(255 -(ncolour-1-i)*100/ncolour,                255 -(ncolour-1-i)*100/ncolour,255 -(ncolour-1-i)*100/ncolour);            // red            colours[i][1]= new Color(255 -(ncolour-1-i)*100/ncolour,0,0);            // green            colours[i][2]= new Color(0,255 -(ncolour-1-i)*100/ncolour,0);            // blue            colours[i][3]= new Color(0,0,255 -(ncolour-1-i)*100/ncolour);            // yellow            colours[i][4]= new Color(255 -(ncolour-1-i)*100/ncolour,                255 -(ncolour-1-i)*100/ncolour,0);            // cyan            colours[i][5]= new Color(0, 255 -(ncolour-1-i)*100/ncolour,                255 -(ncolour-1-i)*100/ncolour);            // magenta            colours[i][6]= new Color(255 -(ncolour-1-i)*100/ncolour, 0,                255 -(ncolour-1-i)*100/ncolour);        }        double len = Math.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 = Math.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 = Math.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,Math.PI/50);        CalcScrPts((double) w/3,(double) h/3, 0);        scale = Math.min(w/3/max/1.2, h/3/max/1.2);        scaleAmt = scale;        scale *= Math.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 + Math.random()*3;        }        if (y > h-scale) {            y = h-scale-2;            iy = -h/100 - 1;        }        if (y-scale < 0) {            y = 2+scale;            iy = h/100 + Math.random()*3;        }        angle += Math.random() * 0.15;        tmp3.Rotation(1, 2, angle);        tmp2.Rotation(1, 0, angle*Math.sqrt(2)/2);        tmp.Rotation(0, 2, angle*Math.PI/4);        orient.M = tmp3.Times(tmp2.Times(tmp.M));        bounce = Math.abs(Math.cos(0.5*(angle)))*2-1;        if (scale > scaleAmt*1.4) {            scaleDirection = DOWN;        }        if (scale < scaleAmt*0.4) {            scaleDirection = UP;        }        if (scaleDirection == UP) {            scale += Math.random();        }        if (scaleDirection == DOWN) {            scale -= Math.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] = Math.cos(angle);        M[j][j] = Math.cos(angle);        M[i][j] = Math.sin(angle);        M[j][i] = -Math.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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲手机成人高清视频| 国产精品免费免费| 成人精品视频一区二区三区| 一区二区三区四区在线播放| 亚洲你懂的在线视频| 亚洲人吸女人奶水| 亚洲精品国产精品乱码不99| 亚洲一区二区四区蜜桃| 一区二区三区精品| 亚洲国产视频网站| 日韩精品每日更新| 紧缚奴在线一区二区三区| 精品一区二区三区视频| 国产成人丝袜美腿| 91视频xxxx| 欧美视频在线一区二区三区 | 亚洲精品乱码久久久久| 中文字幕欧美三区| 亚洲精品免费一二三区| 亚洲综合网站在线观看| 午夜精品久久久久久久99樱桃| 性感美女极品91精品| 美美哒免费高清在线观看视频一区二区| 麻豆精品在线观看| 成人综合婷婷国产精品久久| 日本高清视频一区二区| 欧美人与禽zozo性伦| 欧美v日韩v国产v| 国产视频一区在线播放| 亚洲美女视频一区| 麻豆高清免费国产一区| 国产99久久久精品| 91久久人澡人人添人人爽欧美| 欧美高清激情brazzers| 久久综合中文字幕| 亚洲一区二区成人在线观看| 九色porny丨国产精品| youjizz国产精品| 欧美日精品一区视频| 精品盗摄一区二区三区| 亚洲男人的天堂在线aⅴ视频| 日韩国产在线一| 成人伦理片在线| 91精品国产综合久久婷婷香蕉 | 色综合天天综合网天天狠天天| 欧美精品一卡二卡| 日本一区二区三区四区| 美日韩一区二区三区| 色综合婷婷久久| 久久这里只精品最新地址| 亚洲在线观看免费视频| 国产69精品一区二区亚洲孕妇| 欧美日本国产视频| 最新国产成人在线观看| 捆绑紧缚一区二区三区视频| 在线免费亚洲电影| 久久精品欧美一区二区三区不卡 | 91精品麻豆日日躁夜夜躁| 国产精品伦理在线| 国产精品中文欧美| 精品乱码亚洲一区二区不卡| 天天综合网 天天综合色| 99久久99久久精品免费观看| 久久久久久久久久久电影| 日韩黄色免费网站| 欧美日韩视频第一区| 亚洲精品乱码久久久久久| 成人性视频免费网站| 日韩亚洲欧美高清| 日韩经典一区二区| 欧美高清dvd| 热久久免费视频| 日韩一级大片在线| 秋霞国产午夜精品免费视频| 欧美日韩精品欧美日韩精品一综合| 中文字幕中文字幕一区二区| 懂色中文一区二区在线播放| 久久精品视频在线看| 国产不卡在线播放| 久久久久久久久久久黄色| 麻豆一区二区99久久久久| 日韩美女视频在线| 国产在线不卡视频| 久久九九影视网| 国产91精品一区二区麻豆网站| 欧美国产精品中文字幕| 粉嫩高潮美女一区二区三区| 中文字幕不卡一区| 91视频在线观看免费| 亚洲国产视频直播| 日韩欧美国产1| 国产传媒一区在线| 亚洲日本青草视频在线怡红院| 91福利视频久久久久| 亚洲va欧美va天堂v国产综合| 欧美猛男gaygay网站| 青娱乐精品在线视频| 精品久久久久久久久久久久包黑料| 久久国产尿小便嘘嘘| 国产亚洲精品bt天堂精选| av午夜精品一区二区三区| 亚洲精品中文在线影院| 欧美久久久一区| 国产久卡久卡久卡久卡视频精品| 国产精品久久久久久久浪潮网站| 欧美在线看片a免费观看| 日韩av在线免费观看不卡| 26uuu久久天堂性欧美| 99精品视频中文字幕| 亚洲小少妇裸体bbw| 久久综合丝袜日本网| 99re亚洲国产精品| 日韩高清不卡一区二区| 欧美国产精品一区| 欧美日韩国产乱码电影| 大胆欧美人体老妇| 亚洲高清免费视频| 久久亚洲二区三区| 欧美日韩精品电影| 国产成人av一区二区三区在线 | 久草中文综合在线| 亚洲人123区| 精品区一区二区| 色综合激情久久| 国产一区二区三区在线观看精品| 中文字幕一区av| 久久众筹精品私拍模特| 欧美日本在线观看| 色综合视频一区二区三区高清| 国内国产精品久久| 亚洲成av人片| 一区二区三区在线影院| 久久久久久久综合狠狠综合| 3751色影院一区二区三区| 成人av网站免费观看| 国产在线视频一区二区三区| 亚洲宅男天堂在线观看无病毒| 亚洲国产精品v| 一区二区三区日韩欧美精品| 国产网站一区二区| 欧美一级日韩一级| 91麻豆精品国产91久久久久| 在线免费亚洲电影| 91色porny| 91原创在线视频| www.日韩精品| 99久久777色| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲青青青在线视频| 国产欧美视频在线观看| 久久蜜桃一区二区| 精品国产网站在线观看| 69久久夜色精品国产69蝌蚪网| 欧美在线观看一二区| 色综合激情五月| 欧美亚洲自拍偷拍| 欧美中文字幕一区| 欧美人妇做爰xxxⅹ性高电影| 在线免费观看一区| 在线观看av一区二区| 欧美日韩高清一区二区三区| 日本国产一区二区| 欧美影院精品一区| 欧美一区二区不卡视频| 欧美精品免费视频| 欧美电视剧在线观看完整版| 日韩欧美中文一区二区| 久久午夜免费电影| 国产精品国产三级国产aⅴ无密码| 久久嫩草精品久久久精品| 国产午夜亚洲精品理论片色戒| 国产精品免费视频一区| 亚洲欧美另类久久久精品2019| 亚洲免费av高清| 亚洲国产aⅴ成人精品无吗| 午夜精品久久久久| 国产在线精品免费av| 成人免费高清视频| 在线免费观看一区| 26uuu亚洲综合色| 久久久噜噜噜久久中文字幕色伊伊| 亚洲国产精品二十页| 亚洲美女区一区| 美女一区二区久久| 丁香激情综合五月| 欧美日韩在线免费视频| 久久久www免费人成精品| 亚洲欧美日韩中文播放| 丝袜美腿亚洲综合| 床上的激情91.| 欧美日韩电影在线播放| 久久丝袜美腿综合| 亚洲精品视频在线看| 看国产成人h片视频| 91视频www| 久久尤物电影视频在线观看| 一区二区三区在线视频免费| 国产精品主播直播| 在线综合+亚洲+欧美中文字幕| 中文字幕一区在线观看|