I am trying to use the iGeo library (can be found here:
http://igeo.jp/ ) into eclipse. and I dont get any further...
And this is as far as i get:
import processing.core.PApplet;
import igeo.*;
public class MyIgeoApp extends PApplet{
public static void main(String args[]){
PApplet.main(new String[] {"--present","MyIgeoApp"});
}
//
public void setup(){
size( 480, 360, IG.GL );
for( int i=0; i<10; i++ ){
new IPoint(i, 0, 0);
}
}
public void draw(){
}
}
___
and the java terminal says this to me:
Exception in thread "Animation Thread" java.lang.RuntimeException
at processing.core.PApplet.makeGraphics(PApplet.java:1790)
at processing.core.PApplet.size(PApplet.java:1588)
at processing.core.PApplet.size(PApplet.java:1559)
at MyIgeoApp.setup(MyIgeoApp.java:16)
at processing.core.PApplet.handleDraw(PApplet.java:2103)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:679)
_____
I don't know how to solve this problem. So i have to ask if anybody has experienced the same Problem?
Thx a lot!
DOES ANYBODY KNOW HOW TO USE PVECTOR IN ECLIPSE IN A CLASS?
I just try to build an app with some strings but i dont have any look creating it in eclipse using pvector, here is the code:
public PSpring(PVector position_, float mass_, float radii_, float stiffness_, float damping_,PApplet pp) {
// TODO Auto-generated constructor stub
position = position_;
mass = mass_;
radii = radii_;
stiffness = stiffness_;
damping = damping_;
p = pp;
}
public void update(float tx,float ty){
//update pos
PVector target = new PVector(tx,ty);
PVector force = (PVector.sub(target, position));
force = PVector.mult(force, stiffness);
PVector acceleration = PVector.div(force, mass);
velocity = PVector.add(velocity, acceleration);
velocity.mult(damping);
position = PVector.add(position,velocity);
}
}
this doesnt work.. and what i get is:
Exception in thread "Animation Thread" java.lang.NullPointerException at processing.core.PVector.add(Unknown Source) at processing.core.PVector.add(Unknown Source) at PSpring.update(PSpring.java:32) at main.draw(main.java:20) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:662)