I'm aware that I didn't mention collision detection in my evening update last night. That's for two reasons.
The first and most pressing is that I again spent too much time in Minecraft last night (but, for what it's worth, our castle is decidedly epic).
The second reason is that I didn't have anything of substance worth reporting. I spent a few minutes getting cylinders into the game (a painless task) and then put a few lines of code down for getting the transformation matrices of two objects being tested against one another.
I decided against doing an inverse matrix calculation in lieu of getting the object's transformation matrix by traversing the object tree (starting, of course, at the root object) and pushing/popping the modelview stack as necessary until I stumble across the right object.
From there I can multiply the two matrices to get a transformation matrix that represents the transform from the second object's frame of reference to the first (thereby enabling simple collision detection as described in a previous post).
So I put down a few lines of this code in this vein but it appears I was somewhat reckless (read: didn't prepare at all) so my modelview matrix gets all sorts of wacked out after adding only one object to the scene. The number of matrix pushes does not correlate with the number of matrix pops, so somewhere a stack is getting overloaded after a few rendering frames.
Subsequently, the menu system - which is an orthographic projection, mind you - gets screwed up.
So, when I get home, I'll need to review my method and get things straightened out.
But, in all likelihood, I will play Minecraft instead.
No comments:
Post a Comment