This site requires JavaScript, please enable it in your browser!
Greenfoot back

Zerg's Comments

Back to Zerg's profile

ZergZerg

2009/10/27

mmm... I lied to you... There is a way to do intersection with polygons with only a single linear equation--still not trivial, but also faster. It requires a form of vector parametrization (which may not be trivial) along with the equation for the plane.
ZergZerg

2009/10/23

There is also the linear equation set for determining where the point intersects the plane. This would normally be no problem, but you have to do this for each polygon in the scene to determine which on is "on top" relative to the camera (unless you want to disregard all shading). Like I said, I am speaking from experience; my rasterizer posted previously used this method(minus Z-buffer), and was indeed quite slow. Just want to point out as well that your rigid body simulator is not running 40000(200px by 200px image)+ iterations per act cycle per object, and is also in 2D, not 3D. ... Of course, there really is no better method than yours. :P
ZergZerg

2009/10/22

I would disagree. Finding whether or not a point resides within a triangle requires solving a simultaneous linear equation set in 3 variables--not trivial for a computer!
ZergZerg

2009/10/22

Using triangles results in slow-down issues--not only do you have to find where it intersects, you then have to make sure that it is contained within the triangle. Then you have all the fun of iterating through all the triangles. The biggest issue I think is that Greenfoot/Java was not intended to be able to solve multiple simultaneous equations quickly while iterating. I believe I have read though on some OpenGL for Java... not sure where you would find it, but that would be the way to go for 3D anything.
ZergZerg

2009/10/21

Speaking from experience, you might find this a bit harder than it first appears. I believe that your raytracing algorithm works perfectly for any solid defined by a mathematical function, but I think you could have problems when you define your solid through polygons instead of a function, as you are doing here. Your code is a bit tricky to read (consider intrinsic variable naming?), but I must say I am impressed, particularly with the spherical texture mapping! Do you intend to design lighting shaders as well for your engine?
ZergZerg

2009/10/21

Does this work for other 3D solids besides spheres?
ZergZerg

2009/3/9

Does the large change to the physics engine consist of making it so that you can now jump through ground from the bottom?
Hmm... I can drag my mouse over the red button, and then click it, but nothing happens ;)
ZergZerg

2009/3/3

Very nice!