Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Size problem on two window at the same sketch

$
0
0

Hi Everyone,

I have written a code that uses the "controlP5" library. The sketch has some sliders and textboxes. The setup function of the sketch has the information about the position of the gui elements.

So, I want to make a simulation. In fact, I did on other sketch, but I got a size problem when I implement the simulation and the code on the same sketch. Let me explain a bit more about the simulation :

I used P3D to apply the coordinates of the shape by using vertex function.

Here is a quick example of what I did so far :

          public class SecondApplet extends PApplet {
          public void settings() {
                size(1000, 600,P3D);
              }
          public void setup() {

            translate(width/2,height/3, -200);
            stroke(255);
            noFill();

            beginShape();

            vertex(-82.27,0,47.5); vertex(0,0,-23.75);
            vertex(82.27,0,47.5); vertex(-82.27,0,47.5);


            vertex(-270,0,0); vertex(-65,397.5,0);
            vertex(32.5,397.5,-56.3); vertex(32.5,397.5,56.3);

            vertex(-65,397.5,0); vertex(32.5,397.5,56.3);
            vertex(135,0,233.827); vertex(82.27,0,47.5);

            vertex(0,0,-23.75); vertex(135,0,-233.827);
            vertex(32.5,397.5,-56.3);
            endShape();
          }
        }

        void setup() {
          size(1000,800);
          frameRate(25);

          controlP5 = new ControlP5(this);
          controlP5.setAutoInitialization(false);

          /* Setups of the gui elements ...
              -----------------------*/

          SecondApplet sa = new SecondApplet();
          String[] args = {"TwoFrameTest"};
          PApplet.runSketch(args, sa);
          updateGuiElements();
        }

So, the situation is the size problem on the two windows that I wanted to see when I run the sketch. The main window, which is on the "void setup()" section, is smaller than the second window.

I tried to find out the solution, but I couldn't overcome this problem. What I have to do in order to solve this situation ?

( I tried to explain the problem as well as I can).

I am looking forward to your suggestions. Thanks in advanced.

Have a nice works to all..


Viewing all articles
Browse latest Browse all 2896

Trending Articles