1
Support / Re: Object collision and model loading
« on: May 04, 2012, 04:15:50 am »
Thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
http://www.jpct.net/forum2/index.php/board,3.0.html
If you want you can move it there, but it doesn't really matter
I don't get the question. Formulas to load models? No libraries are being used. It's all build in...but as said: I don't get the actual question...I was wondering what libraries were used for the model loading and collision detection. And for the collision detection, if no libraries were used, what formulas/equations is used to calculate the collision detected.
public SimpleVector deriveAngles(Matrix mat) {
SimpleVector s=new SimpleVector();
float[] m=mat.getDump();
s.x=(float) Math.atan(m[9]/m[10]);
s.y=(float) Math.asin(-m[2]);
s.z=(float) Math.atan(m[4]/m[0]);
return s;
}
Object3d obj1,obj2;
[make objects bla bla bla]
SimpleVector rot = deriveAngles(obj1.getRotationMatrix());
obj2.rotateY(rot.y);
obj2.rotateX(rot.x);
obj.rotateZ(rot.z);
world.addLight(new SimpleVector(0,-50,0),Color.WHITE);
Config.fadeoutLight=false;
world.setAmbientLight(10,10,10);