   Need Help with some unknown Math for various axes and rotations?
  This math issue really isn't for games but I guess could be used in some way...I am going to try and explain this the best I can and I doubt I will get it right the first time so please bare with me.Imagine a cylinder object with some hole on the face of the cylinder. Now this hole is at say X = .175 Y = .325 and the hole angles down at 12 degrees on and angles 13 degrees on the Z axis to the right. What you have their is a compound angle hole. What I need to know is what kind of math am I looking at to be able to take any hole with say a X,Y, C axis coordinate frame of reference and rotate it to some new C axis angle and get the new X,Y coordinates? I have no idea on how to do this or go about it... If I can I will try and draw up something to maybe illustrate this better.ThanksDave[Edited by - MARS_999 on May 23, 2009 7:33:35 PM]
Drawing it out is probably a good idea, but from the sound of it you could do this with typical matrix operations. It may not be entirely accurate, but you can view matrix multiplications as transforming from one coordinate system to another. The rotations can be set up as seperate matrices (axis-angle or yaw-pitch-roll), so in some pseudo-xna-code your base situation would be:Vector3(x=.175, y=.175, z=0) * Matrix.CreateRotationX(12) * Matrix.CreateRotationZ(13);This amounts to your X,Y in coordinatesystem C, where C is the base (cartesian) coordinate system rotate 12 degrees around its X axis and then 13 degrees around its (transformed) Z axis. Now if you would want to transform these coordinates any further, simply construct a matrix representing the new rotation transform and chain it after the existing transforms, like this:Vector3(x=.175, y=.175, z=0) * Matrix.CreateRotationX(12) * Matrix.CreateRotationZ(13) * Matrix.CreateAxisAngle(Vector3.Up, 10);Note that Vector3.Up here means 'Up' the original (cartesian) Y axis, not in the transformed coordinate system C as you might expect. To get the 'Up' vector in your rotated coordinate system C, you can transform it using the same matrices:Vector3.Up * Matrix.CreateRotationX(12) * Matrix.CreateRotationZ(13);Hope this is somewhat useful [smile]