Login
The Persuit of PaperKing - Days 11, 12 & 13 - Fighting with physics
The Persuit of PaperKing - Days 11, 12 & 13 - Fighting with physics
by Chris Raasch on 14 Aug
The last couple days have had flury of work and code being written. Unfortunately almost all of it was to fix the previous version of code. The problems have been primarily in the way the wow engine works, and our learning curve of using it.
The first problem we found was in the use of the bend class. This class will take a papervision object and bend it on the given axis with the given amount of force. This class does this job very well. However we were unable to determine how it was bending the object, and therefore couldn't determine where the object would end. This made it very hard connect multiple segments together. We ended up have to drop the use of the bend class, and the time lost trying to get it to work.
The second problem is still being worked on, but here is the basics. When trying to construct the track segments, we found that many times the ball would "fall through" the track. After a bunch of time verifing that the track polygons were connected properly we still couldn't solve the issue. This almost became a show stopper. Fortunately we found a forum post about the normals of the polygons. It turns out that when we check the normals, some were positive and some were negative. After changing the sequence of the vertex's used to build the polygons we were able to manipulate the polygons so the normals would all be negative. This fixed the straight track segments.
The curved track segments are still problem-matic, and the normals seem to flip as the curve is traversed. This still needs some more research, and may require some runtime manipulation to fix the normals to be negative.
The last problem was performance. The performance would just drop by a large significance with each curve that was being added. When the bend class wouldn't work, we marked the polygon vertices with spheres. Since there are about 20 spheres for each curve, each with 10x10 segments. While trying to fix some other issues with the curves for the curved segments the spheres got turned off. During the next test build the performance increase was incredible. I guess 20x10x10 so about 2000 faces for each segment may be a little high, especially since they didn't really serve any purpose at this time, other than seeing if the curve was correct.
- craasch's blog
- Login to post comments

