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 › 3D window and 2D GUI window
Page Index Toggle Pages: 1
3D window and 2D GUI window (Read 1126 times)
3D window and 2D GUI window
Jan 3rd, 2009, 8:15pm
 
Hey,

I'm using Damkjer's OCD lib for camera control. I'm altering it thought for some specific functions..Nice lib btw, thx.
Anyone know how to make a kind of a split screen mode, where in one I have the camera with 3d interaction and the other only GUI elements? Like in 3D modeling software like blender3d or 3ds Max..
Re: 3D window and 2D GUI window
Reply #1 - Jan 4th, 2009, 4:50am
 
you can try the controlP5 library. the ControlP5window example shows you how to use an extra window with different gui elements to control the main window sketch.
Re: 3D window and 2D GUI window
Reply #2 - Jan 10th, 2009, 3:10pm
 
thx for the reply sojamo. Was hoping there was another way..I'll see if I can do something with translation and scaling..
Re: 3D window and 2D GUI window
Reply #3 - Jan 11th, 2009, 3:02am
 
if u're using opengl mode, look for glViewport(). you can set the render viewport to half screen and use the other "side" to render your GUI using controlP5.


perspective( ... );
camera( ... );
_gl.glViewport( 0, 0, width/2, height );

// do your render here for half screen

// restore viewport.
_gl.glViewport( 0, 0, width, height );
Re: 3D window and 2D GUI window
Reply #4 - Jan 22nd, 2009, 2:57pm
 
Also, if you just want to open another processing window, you can do it like so:

public class UIWindow extends PApplet
{
 Frame frame;
 int width;
 int height;

 UIWindow ( int w, int h )
 {
   width = w;
   height = h;
   frame = new Frame( );
   frame.setBounds( 0, 0, width, height );
   frame.setLocation( 0, 0 );
   frame.add( this );
   this.init( );
   frame.show( );
 }

 void setup( )
 {
    size( width, height, P2D );
    frameRate( 20 );
    frame.setTitle( "MySecondFrame" );
 }

 void draw ( )
 {
   background( 128 );
 }
}

Then you simply init the window in your main applet, like so:

UIWindow uiWindow;

void setup( )
{
   ... whatever you do now ...
   uiWindow = new UIWindow( 640, 480 );
}

You can either let the second window handle it's own drawing or do a noLoop
and call redraw whenever you want to refresh the view. You call any function
in the main applet from within ui window so you can communicate back to
your main view.

Hope this helps.
Page Index Toggle Pages: 1