Skip to content

Instantly share code, notes, and snippets.

@rafalw
Created June 7, 2010 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafalw/429065 to your computer and use it in GitHub Desktop.
Save rafalw/429065 to your computer and use it in GitHub Desktop.
Animowana kula - model punktowy
/*
* Created on 2005-06-15
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package rw.animacja;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferStrategy;
import java.awt.image.MemoryImageSource;
import javax.swing.JFrame;
import javax.swing.Timer;
/**
* Animacja 3D - kula (model punktowy)
*
* @author Rafał Wileczek
* @created 25 lipca 2006
*/
public class Animacja3D extends JFrame implements KeyListener, ActionListener {
private static final long serialVersionUID = 2596382981127077399L;
// Zmienne związane z przechodzeniem na pełny ekran
private GraphicsDevice device;
private GraphicsEnvironment environment;
private BufferStrategy strategy;
private Integer[][] kula = null;
private Integer[][] kula_pers = null;
Integer odl_ekr = 1700;
Integer xo = 0;
Integer yo = 1;
Integer zo = 30;
Double rad_incr = 2 * Math.PI / 720;
Double kat = 0.0;
Integer dx;
Integer dy;
Integer punkty_length;
private Timer timer = null;
private int czas = 10;
/**
* Konstruktor klasy Animacja3D
*
*/
public Animacja3D() {
// Ustawienia okna
setUndecorated(true);
setResizable(false);
// Okno odbiera zdarzenia z klawiszy
setFocusable(true);
addKeyListener(this);
// Anulowanie domyślnego odświeżania ekranu
setIgnoreRepaint(true);
// Pobranie "kontekstu urządzenia"
environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
punkty_length = Kula.kula_punkty.length;
System.out.println(punkty_length);
kula = new Integer[punkty_length][3];
kula_pers = new Integer[punkty_length][2];
timer = new Timer(czas, this);
}
private void kopiujWzor() {
for (int i = 0; i < punkty_length; i++) {
for (int j = 0; j < 3; j++) {
kula[i][j] = Kula.kula_punkty[i][j];
}
}
}
// Przekształcenia afiniczne
private void kula_obrotY(double alfa) {
for (int i = 0; i < punkty_length; i++) {
Double a = kula[i][0] * Math.cos(alfa) - kula[i][2]
* Math.sin(alfa);
Double b = kula[i][0] * Math.sin(alfa) + kula[i][2]
* Math.cos(alfa);
kula[i][0] = a.intValue();
kula[i][2] = b.intValue();
}
}
private void kula_obrotX(double alfa) {
for (int i = 0; i < punkty_length; i++) {
Double a = kula[i][1] * Math.cos(alfa) - kula[i][2]
* Math.sin(alfa);
Double b = kula[i][1] * Math.sin(alfa) + kula[i][2]
* Math.cos(alfa);
kula[i][1] = a.intValue();
kula[i][2] = b.intValue();
}
}
private void kula_obrotZ(double alfa) {
for (int i = 0; i < punkty_length; i++) {
Double a = kula[i][0] * Math.cos(alfa) - kula[i][1]
* Math.sin(alfa);
Double b = kula[i][0] * Math.sin(alfa) + kula[i][1]
* Math.cos(alfa);
kula[i][0] = a.intValue();
kula[i][1] = b.intValue();
}
}
private void kula_pers() {
for (int i = 0; i < punkty_length; i++) {
kula_pers[i][0] = (kula[i][0] * 400) / (odl_ekr + kula[i][2])
+ dx;
kula_pers[i][1] = (kula[i][1] * 400) / (odl_ekr + kula[i][2])
+ dy;
}
}
private void paintCzarny() {
Graphics g = strategy.getDrawGraphics();
Rectangle rect = this.getBounds();
g.setColor(Color.black);
g.fillRect(rect.x, rect.y, rect.width, rect.height);
strategy.show();
}
/**
* Tworzy niewidoczny kursor
*
* @return niewidoczny kursor
*/
private Cursor createTransparentCursor() {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit().createImage(
new MemoryImageSource(16, 16, pixels, 0, 16));
Cursor transparentCursor = Toolkit.getDefaultToolkit()
.createCustomCursor(image, new Point(0, 0), "invisiblecursor");
return transparentCursor;
}
/**
* Wejście w tryb pełnoekranowy
*/
private void setFullScreen() {
device.setFullScreenWindow(this);
// Double buffering
createBufferStrategy(2);
strategy = getBufferStrategy();
Rectangle r = this.getBounds();
dx = (int) (r.getMaxX() / 2);
dy = (int) (r.getMaxY() / 2);
}
/**
* Opuszczenie trybu pełnoekranowego
*/
private void exitFullScreen() {
device.setFullScreenWindow(null);
strategy = null;
}
/**
* Otwarcie okna i rozpoczęcie wyświetlania
*/
public void rozpocznijWyswietlanie() {
// Wejście w tryb pełnoekranowy
setFullScreen();
paintCzarny();
// Prezentacja okna
setCursor(createTransparentCursor());
setVisible(true);
timer.start();
}
private void kresl() {
// Przygotowujemy kulę
kula_pers();
Graphics g = strategy.getDrawGraphics();
g.setColor(Color.black);
Rectangle r = this.getBounds();
g.fillRect(0, 0, r.width, r.height);
g.setColor(Color.GREEN);
// Rysujemy kulę
for (int i = 0; i < punkty_length; i++) {
Integer x = kula_pers[i][0];
Integer y = kula_pers[i][1];
g.drawLine(x, y, x, y);
}
strategy.show();
}
/**
* Zamknięcie okna i przywrócenie wartości początkowych klasy
*/
public void zakonczWyswietlanie() {
timer.stop();
setCursor(null);
exitFullScreen();
setVisible(false);
System.exit(0);
}
// Akcja timera
public void actionPerformed(ActionEvent e) {
kopiujWzor();
kula_obrotX(2 * kat);
kula_obrotY(2 * kat / 3);
kula_obrotZ(kat / 2);
kresl();
kat += rad_incr;
}
// Interfejs KeyListener - implementacja
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
zakonczWyswietlanie();
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (odl_ekr < 10000)
odl_ekr += 50;
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
if (odl_ekr > 1000)
odl_ekr -= 50;
}
}
public void keyReleased(KeyEvent e) {
}
}
package rw.animacja;
/**
* Klasa zawierająca definicje punktów kuli
* (nie pamiętam, skąd wziąłem punkty - chyba z jakiegoś generatora własnego autorstwa)
*
* @author Rafał Wileczek
*
*/
public class Kula {
public static final Integer[][] kula_punkty = {
{ 0, 800, -14 },
{ 3, 800, -14 },
{ 5, 800, -13 },
{ 7, 800, -12 },
{ 9, 800, -11 },
{ 11, 800, -9 },
{ 12, 800, -7 },
{ 13, 800, -5 },
{ 14, 800, -2 },
{ 14, 800, 0 },
{ 14, 800, 3 },
{ 13, 800, 5 },
{ 12, 800, 7 },
{ 11, 800, 9 },
{ 9, 800, 11 },
{ 7, 800, 12 },
{ 5, 800, 13 },
{ 2, 800, 14 },
{ 0, 800, 14 },
{ -3, 800, 14 },
{ -5, 800, 13 },
{ -7, 800, 12 },
{ -9, 800, 11 },
{ -11, 800, 9 },
{ -12, 800, 7 },
{ -13, 800, 5 },
{ -14, 800, 2 },
{ -14, 800, 0 },
{ -14, 800, -3 },
{ -13, 800, -5 },
{ -12, 800, -7 },
{ -11, 800, -9 },
{ -9, 800, -11 },
{ -7, 800, -12 },
{ -5, 800, -13 },
{ -2, 800, -14 },
{ 3, 785, -153 },
{ 29, 785, -150 },
{ 55, 785, -143 },
{ 79, 785, -131 },
{ 100, 785, -115 },
{ 119, 785, -96 },
{ 134, 785, -74 },
{ 144, 785, -50 },
{ 151, 785, -24 },
{ 153, 785, 3 },
{ 150, 785, 29 },
{ 143, 785, 55 },
{ 131, 785, 79 },
{ 115, 785, 100 },
{ 96, 785, 119 },
{ 74, 785, 134 },
{ 50, 785, 144 },
{ 24, 785, 151 },
{ -3, 785, 153 },
{ -29, 785, 150 },
{ -55, 785, 143 },
{ -79, 785, 131 },
{ -100, 785, 115 },
{ -119, 785, 96 },
{ -134, 785, 74 },
{ -144, 785, 50 },
{ -151, 785, 24 },
{ -153, 785, -3 },
{ -150, 785, -29 },
{ -143, 785, -55 },
{ -131, 785, -79 },
{ -115, 785, -100 },
{ -96, 785, -119 },
{ -74, 785, -134 },
{ -50, 785, -144 },
{ -24, 785, -151 },
{ 5, 747, -287 },
{ 55, 747, -281 },
{ 103, 747, -268 },
{ 148, 747, -246 },
{ 188, 747, -216 },
{ 223, 747, -180 },
{ 251, 747, -139 },
{ 271, 747, -93 },
{ 283, 747, -45 },
{ 287, 747, 5 },
{ 281, 747, 55 },
{ 268, 747, 103 },
{ 246, 747, 148 },
{ 216, 747, 188 },
{ 180, 747, 223 },
{ 139, 747, 251 },
{ 93, 747, 271 },
{ 45, 747, 283 },
{ -5, 747, 287 },
{ -55, 747, 281 },
{ -103, 747, 268 },
{ -148, 747, 246 },
{ -188, 747, 216 },
{ -223, 747, 180 },
{ -251, 747, 139 },
{ -271, 747, 93 },
{ -283, 747, 45 },
{ -287, 747, -5 },
{ -281, 747, -55 },
{ -268, 747, -103 },
{ -246, 747, -148 },
{ -216, 747, -188 },
{ -180, 747, -223 },
{ -139, 747, -251 },
{ -93, 747, -271 },
{ -45, 747, -283 },
{ 7, 686, -412 },
{ 79, 686, -404 },
{ 148, 686, -385 },
{ 212, 686, -353 },
{ 270, 686, -311 },
{ 320, 686, -259 },
{ 360, 686, -200 },
{ 390, 686, -134 },
{ 407, 686, -64 },
{ 412, 686, 7 },
{ 404, 686, 79 },
{ 385, 686, 148 },
{ 353, 686, 212 },
{ 311, 686, 270 },
{ 259, 686, 320 },
{ 200, 686, 360 },
{ 134, 686, 390 },
{ 64, 686, 407 },
{ -7, 686, 412 },
{ -79, 686, 404 },
{ -148, 686, 385 },
{ -212, 686, 353 },
{ -270, 686, 311 },
{ -320, 686, 259 },
{ -360, 686, 200 },
{ -390, 686, 134 },
{ -407, 686, 64 },
{ -412, 686, -7 },
{ -404, 686, -79 },
{ -385, 686, -148 },
{ -353, 686, -212 },
{ -311, 686, -270 },
{ -259, 686, -320 },
{ -200, 686, -360 },
{ -134, 686, -390 },
{ -64, 686, -407 },
{ 9, 604, -525 },
{ 100, 604, -515 },
{ 188, 604, -490 },
{ 270, 604, -450 },
{ 344, 604, -396 },
{ 408, 604, -330 },
{ 459, 604, -254 },
{ 496, 604, -171 },
{ 518, 604, -82 },
{ 525, 604, 9 },
{ 515, 604, 100 },
{ 490, 604, 188 },
{ 450, 604, 270 },
{ 396, 604, 344 },
{ 330, 604, 408 },
{ 254, 604, 459 },
{ 171, 604, 496 },
{ 82, 604, 518 },
{ -9, 604, 525 },
{ -100, 604, 515 },
{ -188, 604, 490 },
{ -270, 604, 450 },
{ -344, 604, 396 },
{ -408, 604, 330 },
{ -459, 604, 254 },
{ -496, 604, 171 },
{ -518, 604, 82 },
{ -525, 604, -9 },
{ -515, 604, -100 },
{ -490, 604, -188 },
{ -450, 604, -270 },
{ -396, 604, -344 },
{ -330, 604, -408 },
{ -254, 604, -459 },
{ -171, 604, -496 },
{ -82, 604, -518 },
{ 11, 503, -622 },
{ 119, 503, -610 },
{ 223, 503, -580 },
{ 320, 503, -533 },
{ 408, 503, -469 },
{ 483, 503, -391 },
{ 544, 503, -301 },
{ 588, 503, -202 },
{ 614, 503, -97 },
{ 622, 503, 11 },
{ 610, 503, 119 },
{ 580, 503, 223 },
{ 533, 503, 320 },
{ 469, 503, 408 },
{ 391, 503, 483 },
{ 301, 503, 544 },
{ 202, 503, 588 },
{ 97, 503, 614 },
{ -11, 503, 622 },
{ -119, 503, 610 },
{ -223, 503, 580 },
{ -320, 503, 533 },
{ -408, 503, 469 },
{ -483, 503, 391 },
{ -544, 503, 301 },
{ -588, 503, 202 },
{ -614, 503, 97 },
{ -622, 503, -11 },
{ -610, 503, -119 },
{ -580, 503, -223 },
{ -533, 503, -320 },
{ -469, 503, -408 },
{ -391, 503, -483 },
{ -301, 503, -544 },
{ -202, 503, -588 },
{ -97, 503, -614 },
{ 12, 388, -700 },
{ 134, 388, -687 },
{ 251, 388, -653 },
{ 360, 388, -600 },
{ 459, 388, -528 },
{ 544, 388, -440 },
{ 612, 388, -339 },
{ 662, 388, -228 },
{ 691, 388, -109 },
{ 700, 388, 12 },
{ 687, 388, 134 },
{ 653, 388, 251 },
{ 600, 388, 360 },
{ 528, 388, 459 },
{ 440, 388, 544 },
{ 339, 388, 612 },
{ 228, 388, 662 },
{ 109, 388, 691 },
{ -12, 388, 700 },
{ -134, 388, 687 },
{ -251, 388, 653 },
{ -360, 388, 600 },
{ -459, 388, 528 },
{ -544, 388, 440 },
{ -612, 388, 339 },
{ -662, 388, 228 },
{ -691, 388, 109 },
{ -700, 388, -12 },
{ -687, 388, -134 },
{ -653, 388, -251 },
{ -600, 388, -360 },
{ -528, 388, -459 },
{ -440, 388, -544 },
{ -339, 388, -612 },
{ -228, 388, -662 },
{ -109, 388, -691 },
{ 13, 260, -756 },
{ 144, 260, -743 },
{ 271, 260, -706 },
{ 390, 260, -648 },
{ 496, 260, -571 },
{ 588, 260, -476 },
{ 662, 260, -367 },
{ 715, 260, -246 },
{ 747, 260, -118 },
{ 756, 260, 13 },
{ 743, 260, 144 },
{ 706, 260, 271 },
{ 648, 260, 390 },
{ 571, 260, 496 },
{ 476, 260, 588 },
{ 367, 260, 662 },
{ 246, 260, 715 },
{ 118, 260, 747 },
{ -13, 260, 756 },
{ -144, 260, 743 },
{ -271, 260, 706 },
{ -390, 260, 648 },
{ -496, 260, 571 },
{ -588, 260, 476 },
{ -662, 260, 367 },
{ -715, 260, 246 },
{ -747, 260, 118 },
{ -756, 260, -13 },
{ -743, 260, -144 },
{ -706, 260, -271 },
{ -648, 260, -390 },
{ -571, 260, -496 },
{ -476, 260, -588 },
{ -367, 260, -662 },
{ -246, 260, -715 },
{ -118, 260, -747 },
{ 14, 125, -790 },
{ 151, 125, -776 },
{ 283, 125, -738 },
{ 407, 125, -677 },
{ 518, 125, -596 },
{ 614, 125, -497 },
{ 691, 125, -383 },
{ 747, 125, -257 },
{ 780, 125, -124 },
{ 790, 125, 14 },
{ 776, 125, 151 },
{ 738, 125, 283 },
{ 677, 125, 407 },
{ 596, 125, 518 },
{ 497, 125, 614 },
{ 383, 125, 691 },
{ 257, 125, 747 },
{ 124, 125, 780 },
{ -14, 125, 790 },
{ -151, 125, 776 },
{ -283, 125, 738 },
{ -407, 125, 677 },
{ -518, 125, 596 },
{ -614, 125, 497 },
{ -691, 125, 383 },
{ -747, 125, 257 },
{ -780, 125, 124 },
{ -790, 125, -14 },
{ -776, 125, -151 },
{ -738, 125, -283 },
{ -677, 125, -407 },
{ -596, 125, -518 },
{ -497, 125, -614 },
{ -383, 125, -691 },
{ -257, 125, -747 },
{ -124, 125, -780 },
{ 14, -14, -800 },
{ 153, -14, -785 },
{ 287, -14, -747 },
{ 412, -14, -686 },
{ 525, -14, -604 },
{ 622, -14, -503 },
{ 700, -14, -388 },
{ 756, -14, -260 },
{ 790, -14, -125 },
{ 800, -14, 14 },
{ 785, -14, 153 },
{ 747, -14, 287 },
{ 686, -14, 412 },
{ 604, -14, 525 },
{ 503, -14, 622 },
{ 388, -14, 700 },
{ 260, -14, 756 },
{ 125, -14, 790 },
{ -14, -14, 800 },
{ -153, -14, 785 },
{ -287, -14, 747 },
{ -412, -14, 686 },
{ -525, -14, 604 },
{ -622, -14, 503 },
{ -700, -14, 388 },
{ -756, -14, 260 },
{ -790, -14, 125 },
{ -800, -14, -14 },
{ -785, -14, -153 },
{ -747, -14, -287 },
{ -686, -14, -412 },
{ -604, -14, -525 },
{ -503, -14, -622 },
{ -388, -14, -700 },
{ -260, -14, -756 },
{ -125, -14, -790 },
{ 14, -153, -785 },
{ 150, -153, -771 },
{ 281, -153, -733 },
{ 404, -153, -673 },
{ 515, -153, -593 },
{ 610, -153, -494 },
{ 687, -153, -381 },
{ 743, -153, -256 },
{ 776, -153, -123 },
{ 785, -153, 14 },
{ 771, -153, 150 },
{ 733, -153, 281 },
{ 673, -153, 404 },
{ 593, -153, 515 },
{ 494, -153, 610 },
{ 381, -153, 687 },
{ 256, -153, 743 },
{ 123, -153, 776 },
{ -14, -153, 785 },
{ -150, -153, 771 },
{ -281, -153, 733 },
{ -404, -153, 673 },
{ -515, -153, 593 },
{ -610, -153, 494 },
{ -687, -153, 381 },
{ -743, -153, 256 },
{ -776, -153, 123 },
{ -785, -153, -14 },
{ -771, -153, -150 },
{ -733, -153, -281 },
{ -673, -153, -404 },
{ -593, -153, -515 },
{ -494, -153, -610 },
{ -381, -153, -687 },
{ -256, -153, -743 },
{ -123, -153, -776 },
{ 13, -287, -747 },
{ 143, -287, -733 },
{ 268, -287, -697 },
{ 385, -287, -640 },
{ 490, -287, -564 },
{ 580, -287, -470 },
{ 653, -287, -362 },
{ 706, -287, -243 },
{ 738, -287, -117 },
{ 747, -287, 13 },
{ 733, -287, 143 },
{ 697, -287, 268 },
{ 640, -287, 385 },
{ 564, -287, 490 },
{ 470, -287, 580 },
{ 362, -287, 653 },
{ 243, -287, 706 },
{ 117, -287, 738 },
{ -13, -287, 747 },
{ -143, -287, 733 },
{ -268, -287, 697 },
{ -385, -287, 640 },
{ -490, -287, 564 },
{ -580, -287, 470 },
{ -653, -287, 362 },
{ -706, -287, 243 },
{ -738, -287, 117 },
{ -747, -287, -13 },
{ -733, -287, -143 },
{ -697, -287, -268 },
{ -640, -287, -385 },
{ -564, -287, -490 },
{ -470, -287, -580 },
{ -362, -287, -653 },
{ -243, -287, -706 },
{ -117, -287, -738 },
{ 12, -412, -686 },
{ 131, -412, -673 },
{ 246, -412, -640 },
{ 353, -412, -588 },
{ 450, -412, -518 },
{ 533, -412, -432 },
{ 600, -412, -332 },
{ 648, -412, -223 },
{ 677, -412, -107 },
{ 686, -412, 12 },
{ 673, -412, 131 },
{ 640, -412, 246 },
{ 588, -412, 353 },
{ 518, -412, 450 },
{ 432, -412, 533 },
{ 332, -412, 600 },
{ 223, -412, 648 },
{ 107, -412, 677 },
{ -12, -412, 686 },
{ -131, -412, 673 },
{ -246, -412, 640 },
{ -353, -412, 588 },
{ -450, -412, 518 },
{ -533, -412, 432 },
{ -600, -412, 332 },
{ -648, -412, 223 },
{ -677, -412, 107 },
{ -686, -412, -12 },
{ -673, -412, -131 },
{ -640, -412, -246 },
{ -588, -412, -353 },
{ -518, -412, -450 },
{ -432, -412, -533 },
{ -332, -412, -600 },
{ -223, -412, -648 },
{ -107, -412, -677 },
{ 11, -525, -604 },
{ 115, -525, -593 },
{ 216, -525, -564 },
{ 311, -525, -518 },
{ 396, -525, -456 },
{ 469, -525, -380 },
{ 528, -525, -293 },
{ 571, -525, -197 },
{ 596, -525, -94 },
{ 604, -525, 11 },
{ 593, -525, 115 },
{ 564, -525, 216 },
{ 518, -525, 311 },
{ 456, -525, 396 },
{ 380, -525, 469 },
{ 293, -525, 528 },
{ 197, -525, 571 },
{ 94, -525, 596 },
{ -11, -525, 604 },
{ -115, -525, 593 },
{ -216, -525, 564 },
{ -311, -525, 518 },
{ -396, -525, 456 },
{ -469, -525, 380 },
{ -528, -525, 293 },
{ -571, -525, 197 },
{ -596, -525, 94 },
{ -604, -525, -11 },
{ -593, -525, -115 },
{ -564, -525, -216 },
{ -518, -525, -311 },
{ -456, -525, -396 },
{ -380, -525, -469 },
{ -293, -525, -528 },
{ -197, -525, -571 },
{ -94, -525, -596 },
{ 9, -622, -503 },
{ 96, -622, -494 },
{ 180, -622, -470 },
{ 259, -622, -432 },
{ 330, -622, -380 },
{ 391, -622, -317 },
{ 440, -622, -244 },
{ 476, -622, -164 },
{ 497, -622, -79 },
{ 503, -622, 9 },
{ 494, -622, 96 },
{ 470, -622, 180 },
{ 432, -622, 259 },
{ 380, -622, 330 },
{ 317, -622, 391 },
{ 244, -622, 440 },
{ 164, -622, 476 },
{ 79, -622, 497 },
{ -9, -622, 503 },
{ -96, -622, 494 },
{ -180, -622, 470 },
{ -259, -622, 432 },
{ -330, -622, 380 },
{ -391, -622, 317 },
{ -440, -622, 244 },
{ -476, -622, 164 },
{ -497, -622, 79 },
{ -503, -622, -9 },
{ -494, -622, -96 },
{ -470, -622, -180 },
{ -432, -622, -259 },
{ -380, -622, -330 },
{ -317, -622, -391 },
{ -244, -622, -440 },
{ -164, -622, -476 },
{ -79, -622, -497 },
{ 7, -700, -388 },
{ 74, -700, -381 },
{ 139, -700, -362 },
{ 200, -700, -332 },
{ 254, -700, -293 },
{ 301, -700, -244 },
{ 339, -700, -188 },
{ 367, -700, -126 },
{ 383, -700, -61 },
{ 388, -700, 7 },
{ 381, -700, 74 },
{ 362, -700, 139 },
{ 332, -700, 200 },
{ 293, -700, 254 },
{ 244, -700, 301 },
{ 188, -700, 339 },
{ 126, -700, 367 },
{ 61, -700, 383 },
{ -7, -700, 388 },
{ -74, -700, 381 },
{ -139, -700, 362 },
{ -200, -700, 332 },
{ -254, -700, 293 },
{ -301, -700, 244 },
{ -339, -700, 188 },
{ -367, -700, 126 },
{ -383, -700, 61 },
{ -388, -700, -7 },
{ -381, -700, -74 },
{ -362, -700, -139 },
{ -332, -700, -200 },
{ -293, -700, -254 },
{ -244, -700, -301 },
{ -188, -700, -339 },
{ -126, -700, -367 },
{ -61, -700, -383 },
{ 5, -756, -260 },
{ 50, -756, -256 },
{ 93, -756, -243 },
{ 134, -756, -223 },
{ 171, -756, -197 },
{ 202, -756, -164 },
{ 228, -756, -126 },
{ 246, -756, -85 },
{ 257, -756, -41 },
{ 260, -756, 5 },
{ 256, -756, 50 },
{ 243, -756, 93 },
{ 223, -756, 134 },
{ 197, -756, 171 },
{ 164, -756, 202 },
{ 126, -756, 228 },
{ 85, -756, 246 },
{ 41, -756, 257 },
{ -5, -756, 260 },
{ -50, -756, 256 },
{ -93, -756, 243 },
{ -134, -756, 223 },
{ -171, -756, 197 },
{ -202, -756, 164 },
{ -228, -756, 126 },
{ -246, -756, 85 },
{ -257, -756, 41 },
{ -260, -756, -5 },
{ -256, -756, -50 },
{ -243, -756, -93 },
{ -223, -756, -134 },
{ -197, -756, -171 },
{ -164, -756, -202 },
{ -126, -756, -228 },
{ -85, -756, -246 },
{ -41, -756, -257 },
{ 2, -790, -125 },
{ 24, -790, -123 },
{ 45, -790, -117 },
{ 64, -790, -107 },
{ 82, -790, -94 },
{ 97, -790, -79 },
{ 109, -790, -61 },
{ 118, -790, -41 },
{ 124, -790, -20 },
{ 125, -790, 2 },
{ 123, -790, 24 },
{ 117, -790, 45 },
{ 107, -790, 64 },
{ 94, -790, 82 },
{ 79, -790, 97 },
{ 61, -790, 109 },
{ 41, -790, 118 },
{ 20, -790, 124 },
{ -2, -790, 125 },
{ -24, -790, 123 },
{ -45, -790, 117 },
{ -64, -790, 107 },
{ -82, -790, 94 },
{ -97, -790, 79 },
{ -109, -790, 61 },
{ -118, -790, 41 },
{ -124, -790, 20 },
{ -125, -790, -2 },
{ -123, -790, -24 },
{ -117, -790, -45 },
{ -107, -790, -64 },
{ -94, -790, -82 },
{ -79, -790, -97 },
{ -61, -790, -109 },
{ -41, -790, -118 },
{ -20, -790, -124 }
};
}
/**
*
*/
package rw.animacja;
import javax.swing.UIManager;
/**
* @author Rafał Wileczek
*
*/
public class Kula3D {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
// Wygląd "uniwersalny" Java SWING
try {
UIManager.put("swing.boldMetal", Boolean.FALSE);
UIManager.setLookAndFeel(UIManager
.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) {
}
Animacja3D frame = new Animacja3D();
frame.rozpocznijWyswietlanie();
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment