< prev index next >

src/demo/share/jfc/J2Ddemo/java2d/demos/Colors/Rotator3D.java

Print this page

        

*** 1,8 **** /* * ! * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * --- 1,8 ---- /* * ! * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: *
*** 48,58 **** * 3D objects with color & lighting translated, rotated and scaled. */ @SuppressWarnings("serial") 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 }, --- 48,58 ---- * 3D objects with color & lighting translated, rotated and scaled. */ @SuppressWarnings("serial") 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 },
*** 140,150 **** obj.render(g2); } } } ! public static void main(String argv[]) { createDemoFrame(new Rotator3D()); } /** --- 140,150 ---- obj.render(g2); } } } ! public static void main(String[] argv) { createDemoFrame(new Rotator3D()); } /**
*** 168,179 **** 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; --- 168,179 ---- 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;
< prev index next >