FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   urgent: panels in p5?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: urgent: panels in p5?  (Read 338 times)
dog
Guest
Email
urgent: panels in p5?
« on: May 12th, 2004, 6:36am »

Hi everybody,
I'm new to processing, just been using it for a few weeks.  What I'm trying to do now is to have a simulated 3D world with a control bar with buttons on the side for controlling the world.  After I have created the world, I rotated it to make it look '3D', but the control bar on the side also rotates!  Is there some way to keep the control bar separate, like JPanels in java?  Or if I keep the control bar in another applet, is there some way for the two applets to communicate?
 
Thanks a lot, I really need to know this urgently.
 
 
flight404

WWW Email
Re: urgent: panels in p5?
« Reply #1 on: May 12th, 2004, 7:32am »

dog, check this post... i think it has the information you need.
 
http://processing.org/discourse/yabb/board_Programs_action_disp_lay_num_1083761973.html
 
 
dog
Guest
Email
Re: urgent: panels in p5?
« Reply #2 on: May 12th, 2004, 6:00pm »

The buttons on the top is something like what I'm looking for, I looked at the code and it used an implementation of GUI, which seemed kind of complicated.  Is there an easier way to do it?  I don't need anything fancy, I just need some buttons on the side in a kind of control panel that will stay there no matter how the other stuff is rotated.
 
mKoser

WWW Email
Re: urgent: panels in p5?
« Reply #3 on: May 12th, 2004, 8:13pm »

i just hacked together a quick sketch which uses a BGraphics object to store the GUI, and then copies this onto the screen whenever you wish to show the GUI.
 
http://proce55ing.beyondthree.com/sketch/bgraphics_gui/
 
hope that helps, and happy hacking!
 
+ mikkel
 

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
JohnG

WWW
Re: urgent: panels in p5?
« Reply #4 on: May 13th, 2004, 1:53pm »

One thing you can do, to make life easier, is to use push() and pop()
 
So you have:
 
void loop()
{
  background(0);
  push();
    do all the 3D stuff
  pop();
    do all the 2D stuff
}
 
After the pop(), all the 3d roations, translations etc are thrown away, so that 0,0 is once again the top left of the screen, and the x and y axes are where you think they should be.
 
mKoser

WWW Email
Re: urgent: panels in p5?
« Reply #5 on: May 13th, 2004, 2:01pm »

reg. push() / pop()
hehe yes of course you could do it like that aswell, for some reason i had understood the original problem to be 'how to create a GUI without using push() pop()' ... ehm, re-reading it now, i see that wasn't the case!
 

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
dog
Guest
Email
Re: urgent: panels in p5?
« Reply #6 on: May 13th, 2004, 8:47pm »

Thank you so much!
I kind of thought it had something to do with push and pop, but I didn't really know what they were for at the time!  
So now I have what I want...and thanks for the gui hack!  I'll need that for something else...cos i'll have something else floating around the place.
I have one more question which is probably stupid...can you get rid of the outlines of a rectangle?  When I draw a rect, the outlines are in black...anyway to have no outlines?
 
dog
Guest
Email
Re: urgent: panels in p5?
« Reply #7 on: May 13th, 2004, 8:55pm »

Er, nevermind!  Haha..I just found the stroke() function...
 
Pages: 1 

« Previous topic | Next topic »