-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to show different views with IPanel? #14
Comments
Because I didn't expect to use in that way, it's ugly but the below should work in Processing 2.2.1. import igeo.*; import igeo.gui.*; size(800,400,IG.GL); IGridPanel gridPanel = (IGridPanel)IG.cur().panel; gridPanel.setupGrid(2, 1, null); IPane pane1 = gridPanel.gridPanes[0][0]; IPane pane2 = gridPanel.gridPanes[1][0]; IView view1 = IView.getTopView((int)pane1.getX(),(int)pane1.getY(),pane1.getWidth(),pane1.getHeight()); view1.enableGL(); view1.setMode(new IGraphicMode(IGraphicMode.GraphicType.GL, false, true, false)); // fill false, wire true, transparent false IView view2 = IView.getDefaultPerspectiveView((int)pane2.getX(),(int)pane2.getY(),pane2.getWidth(),pane2.getHeight()); view2.enableGL(); view2.setMode(new IGraphicMode(IGraphicMode.GraphicType.GL, true, true, false)); // fill true, wire true, transparent false pane1.setView(view1); pane2.setView(view2); pane1.navigator().setRotateLock(true); gridPanel.gridPanes[0][0].setVisible(true); gridPanel.gridPanes[1][0].setVisible(true); for(int i=0; i<100; i++){ IVec pos = IRand.pt(100); new ISurface(pos, pos.cp(5,0,0), pos.cp(5,5,0), pos.cp(0,5,0)).clr(IRand.clr()); } |
Hi Satoru, |
Can you put different geometries in locations far apart and set the views to show each? |
Sorry for the late reply, I used the first trick you suggested and it works! Thank you so much! |
Satoru, I found the refpiGeon method in Nathan Miller Supershape 3D template: public void refpiGeon(){ for (IPoint pt:ptarr){ for (ICurve crv:crvarr){ for (ISurface srf:srfarr){ for (IBrep brep:breparr){ for (IMesh mesh:mesharr){ Is it possible to lock rotation and translation in the window and rotate only pressing a key in the keyboard (having only one IPane and one view)? Regards, |
Hi Satoru,
my compliments for your library! I'm using IGeo to draw Nurbs Curves and then construct a Surface with IG.loft (after a few transformations). I would like to show in the same window two different views of my geometries (IG.top of the curves and IG. perspective of the Surface) and I guess I have to use two different IPanes.
Is it possible to use IGeo GUI with Processing 2.2.1? ( When I try to run a sketch I get the error unexpected token: package in reference to the first line package igeo.gui; )
How can I use the IPanel to get the result I need?
Is there any tutorial about this issue?
Thanks in advance!
The text was updated successfully, but these errors were encountered: