3
在C++中,我们可以旋转点左右任意轴:椭圆旋转矩阵?
void radRotateAxis(float a, float b, float c, float theta) { float newX = ( x*(a*a*(1-cos(theta)) + cos(theta) ) + y*(a*b*(1-cos(theta)) - c*sin(theta)) + z*(a*c*(1-cos(theta)) + b*sin(theta))); float newY = ( x*(a*b*(1-cos(theta)) + c*sin(theta)) + y*(b*b*(1-cos(theta)) + cos(theta) ) + z*(b*c*(1-cos(theta)) - a*sin(theta)) ); float newZ = ( x*(a*c*(1-cos(theta)) - b*sin(theta)) + y*(b*c*(1-cos(theta)) + a*sin(theta)) + z*(c*c*(1-cos(theta)) + cos(theta) ) ); x = newX ; y = newY ; z = newZ ; }
但是,当我们走THETA 0 - > 2PI这发生在点周围“单位圆”在你身边会围绕
轴我们怎样才能使它成为θ0 - > 2PI结果是关于一个椭圆的宽度a,高度b?
我不想将转动矩阵旋转到轴上之后应用转换矩阵 - 我正在寻找的是一个“椭圆”旋转矩阵,如果有人知道这样的事情!
在特定的数学论坛上问你可能会更好。 – Noldorin 2009-07-06 13:45:14