Member

5

102 Neutral

• Rank
Newbie
1. Matrix to vector?

Wow, yeah that was crazy easy. I cross-referenced Wikipedia on Perspective projection matrices, your simple suggestion + Wikipedia made it obvious. Here's what I ended up with: [source lang="java"] public static Matrix4f fromVector(Vector3f vector) { Matrix4f matrix = new Matrix4f(); matrix.m30 = vector.x; matrix.m31 = vector.y; matrix.m32 = vector.z; matrix.m33 = 1; return matrix; } public static Vector3f toVector(Matrix4f matrix, Vector3f vector) { vector.x = matrix.m30; vector.y = matrix.m31; vector.z = matrix.m32; return vector; } public static void mul(Matrix4f left, Vector3f right, Vector3f result) { Matrix4f matrix = fromVector(right); Matrix4f.mul(left, matrix, matrix); toVector(matrix, result); }[/source]
2. Matrix to vector?

Heya! I've got a tree of objects, each with their own transformation matrices relative to their parent object. Give an object anywhere in the tree, I'd like to find it's absolute position from the origin. This is simple enough: I walk down the tree, applying each transform along the way, 'till I hit the object in question. The resultant matrix gives the absolute transformation matrix. What's the best way to turn this in to a vector that is the position relative to the origin? I have bounding boxes around each element, and I'd like to use this to find collisions. I may be making this more complicated than I need to...

I've never hugged my coworkers when leaving a job. That is, until now. Will miss @AboutUs a lot!

wow that is exciting! RT @deschutesbeer: It's an exciting day here at the brewery. The heirloom cascade hops are being picked for the 1st...

who's headed to the @piepdx grand opening tonight?

every day I wake up and say to myself "thank god I am not a DBA."

amazing article in willamette weakly about the Timbers Army. I'm pretty damn proud! http://ow.ly/6iT99

English language is crazy. To us "yaonor" = "your honor." Always blows me away.

man, the fat ppl just keep getting fatter.

graphing in javascript is painful as hell.

most important thing about a logo? that it looks AWESOME on a sticker!

ugh, i hate this part #anothervaguetweet

did I hear that right?