private void btn_viewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_viewActionPerformed
        float rad;
        for (int i = 0; i < numPoint; i++) {
            if ( (lengthToCenter-maxObjlen)<dataSet[i] &&  (lengthToCenter+maxObjlen)>dataSet[i] ) {
                rad = (lengthToCenter - dataSet[i]);
            }else{
                rad = 10;
            }

//            if (i % roundStep <= (roundStep - 1) / 4) {
//                x[i] = maxObjlen + (float) (rad * Math.cos(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//                y[i] = maxObjlen + (float) (rad * Math.sin(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//            } else if (i % roundStep <= (roundStep - 1) / 2) {
//                x[i] = maxObjlen + (float) (rad * Math.cos(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//                y[i] = maxObjlen + (float) (rad * Math.sin(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//            } else if (i % roundStep <= (roundStep - 1) * 3 / 4) {
//                x[i] = maxObjlen + (float) (rad * Math.cos(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//                y[i] = maxObjlen + (float) (rad * Math.sin(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//            } else if (i % roundStep <= (roundStep - 1)) {
//                x[i] = maxObjlen + (float) (rad * Math.cos(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//                y[i] = maxObjlen + (float) (rad * Math.sin(Math.toRadians((double) ((i % roundStep) * 360 / roundStep))));
//            }

            x[i] = Math.abs(maxObjlen + (float) (rad * Math.cos(Math.toRadians((double) ((i % roundStep) * 360 / roundStep)))));
            y[i] =Math.abs( maxObjlen + (float) (rad * Math.sin(Math.toRadians((double) ((i % roundStep) * 360 / roundStep)))));
            System.out.println(x[i] + ", " + y[i]);

        }


        Coord3d[] points = new Coord3d[numPoint];
        for (int i = 0; i < numPoint; i++) {
            try {
                float z = (float) ((i / roundStep)+1);
                points[i] = new Coord3d(z,x[i], y[i]);
                System.out.println(z + ", " + x[i] + ", " + y[i]);
            }catch(Exception e){
                System.out.println(e);
            }
        }


//        points[0] = new Coord3d(1, 1, 1);
//        points[1] = new Coord3d(1, 10, 1);
//        points[2] = new Coord3d(1, 1, 10);
//        points[3] = new Coord3d(10, 10, 1);
//        points[4] = new Coord3d(10, 1, 1);
//        points[5] = new Coord3d(1, 10, 10);
//        points[6] = new Coord3d(10, 1, 10);
//        points[7] = new Coord3d(10, 10, 10);
        try {
            MultiColorScatter scatter = new MultiColorScatter(points, new ColorMapper(new ColorMapRainbow(), 0, 0));
            float f = Float.parseFloat(txt_pointSize.getText());
            scatter.setWidth(f!=0?f:5);

            chart = new Chart();
            chart.setViewMode(ViewPositionMode.FREE);


            chart.setAxeDisplayed(axisVisible);

            chart.getAxeLayout().setMainColor(mainColor);
            chart.getView().setBackgroundColor(bgColor);


            chart.getScene().add(scatter);
            
            ChartLauncher.openChart(chart,"LEGION Virtual 3D Designer");



        } catch (Exception e) {
            System.out.println(e);
        }


//        JInternalFrame frame = new JInternalFrame();
//        frame.setClosable(true);
//        frame.setMaximizable(true);
//        frame.setIconifiable(true);
//        frame.doDefaultCloseAction();
//        jDesktopPane1.add(frame);
//        frame.setSize(720, 720);
//        MyShape shape = new MyShape(x, y);
//        frame.add(shape);
//        frame.setVisible(true);

    }//GEN-LAST:event_btn_viewActionPerformed