   Getting the Forward, Up and Right direction vector from a pitch yaw and roll angle
  I've seen a thread with this question but the solution was without using roll and roll is what I need. This was the thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=415144&whichpage=1�I'm doing this in lua so this was the outcome of that:local cos = math.coslocal sin = math.sinlocal rad = math.radlocal sqrt = math.sqrtfunction meta:Forward()local pitch,yaw,roll = rad(self.x),rad(self.y),rad(self.z)local x = sin(yaw) * cos(pitch)local y = sin(pitch)local z = -cos(yaw) * cos(pitch)local mag = sqrt(x*x + y*y + z*z)x = x/magy = y/magz = z/magreturn Vector(x,y,z)endThis is being done in Crysis and the outcome is wrong. I'm drawing some lines and stuff but they all go around in weird cos and sin ish rotations. I'm hoping this is because of the lack of roll.I'm very bad at this, so code would really help! (I'm saying I prefer code over a lot of explanation)Edit:Solved on some other forum!here's the code that was the solutionfunction meta:Forward()local pitch, yaw, roll = rad(self.x), rad(self.y), rad(self.z)local x = cos(roll) * cos(yaw)local y = sin(roll) * cos(yaw)local z = -sin(yaw)local mag = sqrt(x*x + y*y + z*z)x = x/magy = y/magz = z/magreturn Vector(x,y,z)endfunction meta:Up()local pitch, yaw, roll = rad(self.x), rad(self.y), rad(self.z)local x = -sin(roll) * cos(pitch) + cos(roll) * sin(yaw) * sin(pitch)local y = cos(roll) * cos(pitch) + sin(roll) * sin(yaw) * sin(pitch)local z = cos(yaw) * sin(pitch)local mag = math.sqrt(x*x + y*y + z*z)x = x/magy = y/magz = z/magreturn Vector(x,y,z)endfunction meta:Right()local pitch, yaw, roll = rad(self.x), rad(self.y), rad(self.z)local x = sin(roll) * sin(pitch) + cos(roll) * sin(yaw) * cos(pitch)local y = -cos(roll) * sin(pitch) + sin(roll) * sin(yaw) * cos(pitch)local z = cos(yaw) * cos(pitch)local mag = math.sqrt(x*x + y*y + z*z)x = x/magy = y/magz = z/magreturn Vector(x,y,z)endI was thinking that I had to normalize the outcome, cause the vectors went above 1 and such, is this necessary?[Edited by - CapsAdmin on April 20, 2010 11:13:32 AM]