GLFrame(JTextArea outputArea) {
   this.outputArea = outputArea;
   GLCapabilities caps = new GLCapabilities(Configuration.getMaxCompatibleGLProfile());
   caps.setAlphaBits(8);
   caps.setRedBits(8);
   caps.setGreenBits(8);
   caps.setBlueBits(8);
   GLCanvas glCanvas = new GLCanvas(caps);
   glCanvas.addGLEventListener(this);
   this.add(glCanvas);
   this.setSize(200, 200);
 }
Пример #2
0
  public DrawByLevelFractal() {
    baseDir = "CS371/assignments/assignment02/ifs/";

    ifsFiles = new ArrayList<String>();
    ifsFiles.add("carpet.ifs");
    ifsFiles.add("chaos.ifs");
    ifsFiles.add("coral.ifs");
    ifsFiles.add("curl.ifs");
    ifsFiles.add("four.ifs");
    ifsFiles.add("galaxy.ifs");
    ifsFiles.add("dragon.ifs");
    ifsFiles.add("leady.ifs");
    ifsFiles.add("koch.ifs");
    ifsFiles.add("mouse.ifs");
    ifsFiles.add("leaf.ifs");
    ifsFiles.add("seven.ifs");
    ifsFiles.add("three.ifs");
    ifsFiles.add("tri.ifs");

    pointsToDraw = 80000;
    left = -7;
    right = 7;
    bottom = -7;
    top = 11;
    xOrigin = 0;
    yOrigin = 0;

    rotate_scale_xx = new double[maximumTransitions];
    rotate_scale_xy = new double[maximumTransitions];
    rotate_scale_yx = new double[maximumTransitions];
    rotate_scale_yy = new double[maximumTransitions];
    trans_x = new double[maximumTransitions];
    trans_y = new double[maximumTransitions];
    prob = new double[maximumTransitions];

    caps = new GLCapabilities(GLProfile.getGL2GL3());
    caps.setDoubleBuffered(true); // request double buffer display mode
    caps.setHardwareAccelerated(true);
    canvas = new GLJPanel();
    // canvas.setOpaque(true);
    canvas.addGLEventListener(this);
    canvas.addKeyListener(this);
    animator = new FPSAnimator(canvas, 60);

    getContentPane().add(canvas);
  }