[Plib-users] 'World' to 'Local' body velocity transform
Brought to you by:
sjbaker
From: McEvoy, N. <nic...@ds...> - 2001-12-03 04:49:19
|
I finally have to admit my knowledge of matrix math is very bad !!! :-( I have been struggling with this 'simple' problem for a few days now ... and it is driving me crazy ! Say, I have a 'Body' travelling with a given 'world' velocity and a HPR. As the 'Body' changes HPR I want to know what the velocity is in relation to the 'bodies local axis' (by this I mean assume the body is facing +ve Y direction, +ve Z up, +ve X right ... local coords not world coords) ... (I hope this makes sense). ----------------------------------- Example with body at some hpr (assume the body is facing +ve Y direction, +ve Z up, +ve X right) @=World body velocity (XYZ) *=Local body velocity (xyz) ----------------------------------- +Z +Y +y | / / | / *-- +z |/ \ @----+X +x I have written some code to rotate the 'world' velocity by the bodies HPR ... but I think this is giving me incorrect results (maybe its the Eulers are Evil problem: http://www.sjbaker.org/steve/omniv/eulers_are_evil.html) ... but it is hard to say for sure ... (ODE physics engine is involved too ... and at certain HPR the forces I apply to the 'Body' cause it to accelerate off the screen) ... MORE EXPLANATION ... The whole reason why I want to do this is to apply a damping force to my 'Body' in (xz) directions normal to its +y heading (at some ratio to the velocity in these normal directions) ... The reason I have not posted my code is so that I do not confuse the issue ... I'm just interested in how other people might suggest to write the code (using PLIB routines of course) ... HELP ANY SUGGESTIONS PLEASE (I wish I paid attention in high-school math) !!! Nick _________________________________________ Nick McEvoy WorkMail: mailto:nic...@as... HomeMail: mailto:ndm...@oz... HomePage: http://members.ozemail.com.au/~ndmcevoy/ _________________________________________ |