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.
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
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!
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.
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?
2009/10/27
3D Earth
2009/10/23
3D Earth
2009/10/22
3D Earth
2009/10/22
3D Earth
2009/10/21
3D Earth
2009/10/21
3D Earth
2009/3/9
Zony
2009/3/5
Pay Check
2009/3/3
Bomber