A more productive week this week. Project-wise things have gone better, but at the same time they've gotten worse.
This week was spent on the splitting part of my algorithm. Since I was unable to make a mesh out of my crack patterns I'm stuck with trying to disect a box with a plane. Shouldn't be too hard really but if I set it up right there shouldn't be any difference between splitting this and a proper crack pattern. However, most of my week was spent wondering why I was getting squiggly lines. The answer was that I was getting a CustomVertex.PositionNormal when I was meant to be getting a CustomVertex.PositionNormalTextured. The extra information was throwing everything off. Once I had that I discovered another thing. Each mesh has it's vertices "welded" i.e. for each normal of a vertex there is a separate vertex. This shouldn't cause me problems but may make normal computation difficult (however, i believe that I can perform this welding operation as a post-process and then calculate the normals again).
The next part of my week was spent wondering why I wasn't getting any triangles on one side. After discussion with my tutor I finally got the correct algorithm. This algorithm basically is joining a vertex in the target mesh to one in the plane's vertices. Perform a dot product on that vector and the normal of the triangle. However, this still didn't work as each vertex in the target was always over 90 degrees to the normal of the triangle at least once. I managed to get it to give out some vertices by changing the algorithm slightly (connect each vertex in the target to a different one in plane each time) but these positions appeared incorrect. After determining that they were incorrectly wound I re-wound them and tried again. Same problem.
It is at this point that I remain. I do not know why my program wants to make a triangle through my box when none of the triangles given to it do this.
Whilst I tried to figure out this problem I continued with my clipping algorithm. It is currently set up so that if one of the vertices on the correct side of the plane's triangle then it will perform a plane intersect with one of the two polygons and make 2 new vertices. The version for 2 vertices on the correct side will be similar but will create 2 triangles instead of just 1 (this bit hasn't been implemented yet).
If you'd like to have a look at this thing run you're more than welcome to it. It'll need .NET 2.0 and DX9 Feb06 to run but if you want to compile it you'll need VS2005 and the DX SDK. You shouldn't need a fast computer. Running the release .exe I got a frame-rate of 2000fps+
Current Project Source
As a bonus, if anyone can work out why this isn't working I'll be extraordinarily grateful.
What annoys me most of all about this is that I know I'm so close but I lack the other people in my department who know enought about 3D graphics to help me (and it doesn't help that my deparment's lab computers still run Win2000 so I can't install the DX SDK, nor do I have a laptop).
On a slightly happier note, the university's rowing club has asked to use the hockey website's teamsheet system for sorting their boats and crews. I've agreed to meet with them after my dissertation has been handed in but it's all looking good there.
I've got myself a job interview for the summer, working at the uni's IT center writing report forms for a new Oracle database..... fun fun (pay is half decent tho).
Extra-curricular activities (i.e. hockey) brings some good news too. The saturday hockey team (Sheffield Uni Bankers 9s) are currently top of the league and a win tomorrow will pretty much guarentee promotion, though full points from both of the final matches is needed to make sure we finish top.
Finally, I'm off home home this weekend to relax for once.
Steve
Currently Listening To: Gnarls Barkley - Crazy
Currently Watching: Maid Marian and her Merry Men (early 90s kids tv, effin awesome)
Currently Reading: Anything I can find on intersection
Currently Eating: Pringles
Weeks of coding left: 1