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.
Page Index Toggle Pages: 1
geogebra (Read 1163 times)
geogebra
May 10th, 2010, 2:48am
 
hi there..

I'd like to program geogebra but in 3d. it should look like geogebra. does anybody of you know how I should do that (as easy as possible)
the problem is that I have to combine 3d and 2d and different "frames".. in another topic someone has given me this link:
http://processing.org/discourse/yabb2/num_1272389054.html
is there an easier option how would you solve this problem

thank you for your help..
Re: geogebra
Reply #1 - May 10th, 2010, 7:11am
 
Obviously I'm biased, since I wrote the library you're linking to.  But napplet was designed to be as simple and easy to use as possible for a novice/new Processing programmer, and I doubt you're going to find an easier way of doing it.  Try following the examples, and if you have questions about using it, feel free to ask in the napplet thread.

And please don't take this the wrong way, but geogebra is a pretty complex program; it only looks simple to the user (that's what makes it so good).  Even writing a minimally-functional clone would be a major project; for a beginner to Processing, you might want to start with something a little less ambitious.
Re: geogebra
Reply #2 - May 10th, 2010, 7:37am
 
thank you, I'll try it.. I know that I'll not be able to make something that you can compare to geogebra but it's my job to do something in this way (at school). It hasn't to be that good but it's a good example to explain what I mean..

But thank you for your help.. I'll have a look on it!
Re: geogebra
Reply #3 - May 11th, 2010, 10:04am
 
I'm not a huge fan of using libraries myself, so when I wanted to have both a 2D and 3D view in the same sketch, I actually programmed the sketch to have both a 2D and a 3D view. Here's the classic example sketch I give:

Quote:
/// "ThreeViews" by TfGuy44 (TfGuy44@gmail.com)
PGraphics BC, GC, RC;
float rot = 0.0;

void setup(){
  size( 400, 200, P2D);
  BC = createGraphics(200, 200, P3D);
  RC = createGraphics(200, 200, P3D);
  GC = createGraphics(200, 200, P3D);
}

void draw(){
  rot=(rot+0.01)%360;
  background(0);
  noStroke();
  fill(color(255,0,0));
  rect(10,40,20,20);
  fill(color(0,0,255));
  rect(70,70,20,20);
  fill(color(0,255,0));
  rect(70,10,20,20);
  if( get( mouseX, mouseY ) == color(255,0,0) ){
    RC.beginDraw();
    RC.background(color(128,0,0));
    RC.fill(color(255,0,0));
    RC.lights();
    RC.translate(100,100,0);
    RC.rotateX(rot);
    RC.rotateY(2*rot);
    RC.box(20);
    RC.endDraw();
    image( RC.get(), 200, 0);
  }
  if( get( mouseX, mouseY ) == color(0,255,0) ){
    GC.beginDraw();
    GC.background(color(0,128,0));
    GC.fill(color(0,255,0));
    GC.lights();
    GC.translate(100,100,0);
    GC.rotateX(rot);
    GC.rotateY(2*rot);
    GC.box(50);
    GC.endDraw();
    image( GC.get(), 200, 0);
  }
  if( get( mouseX, mouseY ) == color(0,0,255) ){
    BC.beginDraw();
    BC.background(color(0,0,128));
    BC.fill(color(0,0,255));
    BC.lights();
    BC.translate(100,100,0);
    BC.rotateX(rot);
    BC.rotateY(2*rot);
    BC.box(80);
    BC.endDraw();    
    image( BC.get(), 200, 0);
  } 
}

Page Index Toggle Pages: 1