First create the rotation matrix for the gun.
second, place the gun at the hand
third, make the rotation & translation matrix for the player
fourth, mulitiply the gun matrix by the player matrix.
something like this..
gun_matrix = Matrix.Identity * Matrix.CreateRotationXXX( rotations )
gun_matrix.Translation = position_of_players_hand
player_matrix = Matrix.identity * Matrix.createrotationsxxxx(player rotations)
player_matrix.Translation = position_of_player
//now rotate the gun by the player matrix, which will also move it relative to the player
gun_matrix *= player_matrix
best,
Byron
..shaders make you feel... powerful, or very very stupid.
http://drjbn.spaces.live.com/