Matrix4f rotation and movement interaction problem

Hi Crew,

Ok… im having what i thought should be simple but i must be missing something.

I have a object in my world. (camera)
I represent its location using a Matrix4f.

I want to be able to rotate the object and then move it forward where forward has been affected by the rotation.
ie… rotate roll 45 degree then pitch 45 … forward is now 45 / 45 and move forward 100.

in multiplying my matrices however the rotation works fine… but the forward direction is unaffected.
(it will move forward ignoring the rotation)

so im clearly missing something that likely is very newbish on my part.

any help is appreciated.

j.

just to be sure … u use a up and side vector to build the matrix, right ?

yes thats right…

if anyone has a really good tutorial link for this it would be much appreciated.
im sure im just missing one little detail.

j.

You can always think of a matrix as being a set of equations instead of being a single thing. So when you multiple a matrix by a vector then it’s equivalent to performing 3 dot products (only effectively 4x3 or 3x4 for rotation + translation)…I’m assuming we’re not talking about a projection matrix. Dot products are a parallel projection of one system into another.

(SEE here: http://www.java-gaming.org/topics/inverting-matrices/34125/msg/322124/view.html#msg322124). The upper 3x3 part (what I calling R) in that thread basically defines the local coordinate system of the transform. So the rows (or columns depending on convention) of R are directly how local X,Y & Z coordinate frame of the transform are related to it’s parent. So you can just directly pull out forward, right, up (assuming right handed convention) from the approp. row or column. Grab forward, multiply by distance and add to translation…done.