Tuesday, July 04, 2006

Spatial Subdivisions... here we go

Today I spent a long time re-arranging a whole bunch of code to try to get Spatial Subdivisions started correctly. I had to write Axis-Aligned Bounding Boxes for every primitive, write methods to convert these between spaces (and when they get turned into Oriented Bounding Boxes, to convert them back to the correct kind of Axis-Aligned Bounding Boxes)... oh man!! Crazyness.

Anyway after all of that, I setup my 3D Voxel Grid, and calculated the extent of my scene. I don't think I am totally doing this right, but it is sortof right. At least it looks like my Voxels are being created correctly and they are all the right dimensions. Then I started the 3D-DDA algorithm, attempting to trace my ray through the Voxels. I think I currently have a problem where my Ray origin is not inside a Voxel and I have to move the ray up to the point of the first Voxel, or something like that. Either way, this is nuts. Especially nuts that I am trying to do this in like 2 days, while researching the Siggraph Papers and trying to understand what to do. Insane. Anyway hopefully I can get this figured out. I wrote a LOT of code for this today, so I don't want it to go to waste or to be silly and give up on this. I do have a week to decide if I am going to do these subdivisions or not, so we'll see how it goes. I want to do this but I only have 2.5 weeks for the whole project, and I have 10 objectives total. I have only done 1 so far (refraction) as you can see from my earlier posts, so it is a pretty limited time to learn all this stuff and implement it. Hehe oh yeah, I better remember to do my homework for my 4 other classes too. :)

Well anyway, although this is pretty darn complicated, I have already learned a lot today about Axis-Aligned Bounding Boxes vs. Oriented Bounding Boxes, and how to make sure you convert these correctly between spaces, that was pretty cool. Also I guess I got a lot further than I expected in the first go at this. I've only spent 10 hours or so on this tonight, and I am already in the Line Algorithm part, so I guess that is good progress. I still need to do the Voxel-Primitive intersections to assign a primitive list to a voxel, but I am already setup to add that functionality after I get the ray traversal correct.

So hopefully I can figure this out over the next few days and then move onto my easier objectives. I thought this might be a hard objective compared to the other ones, and apparently it is. :) Hehe well, at least I have 15 days to do this Project?! Oh man, Waterloo, you are crazy.

I won't have too many pretty pictures over the next few days since I am working on this efficiency algorithm at the moment, but here's one from this afternoon.


Axis-Aligned Bounding Boxes in Model Coordinate Space

No comments: