We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Split Plane in Processing
Page Index Toggle Pages: 1
Split Plane in Processing (Read 411 times)
Split Plane in Processing
Jun 25th, 2008, 9:32pm
 
Is it possible to split the viewport into two panes?

My problem is that I am using the controlP5 controls in an OpenGL setting, in which I want to be able to zoom in and out. controlP5 draws the controls at the specified coordinate locations, and thus scales them as well when zooming.

I thought if I were to split the viewport, perhaps I could put the controls on one side. Or is there another way around this problem?

Thanks,
Ben
Re: Split Plane in Processing
Reply #1 - Jun 26th, 2008, 6:39am
 
I had a similar problem.  Rather than using panes, I drew a static transparent layer on top of the zoomed image using the pushMatrix() and popMatrix() functions like this:

Quote:

void draw() {
   pushMatrix();
   // Do your usual drawing here with scaling, translating, etc. as needed
   // to achieve the zooming effects.
   popMatrix();
   // Now you can draw whatever you want on top of your zoomed image
   // in the viewport's original (un-zoomed) coordinate system.
   // You could add code that draws a separate pane with controls on it here.
}


I hope this helps!
Page Index Toggle Pages: 1