我在這裏有在C#中的一些代碼C#矩陣到Android矩陣?
//take a world Vector2D and make it a relative Vector2D
public Vector2D WorldToRelative(Vector2D world)
{
Matrix mat = new Matrix();
PointF[] Vectors = new PointF[1];
Vectors[0].X = world.X;
Vectors[0].Y = world.Y;
mat.Rotate(-m_angle/(float)Math.PI * 180.0f);
mat.TransformVectors(Vector2Ds);
return new Vector2D(Vectors[0].X, Vectors[0].Y);
}
問題是Android的矩陣似乎並不具備旋轉和變換向量。
它有前後旋轉和映射向量。
我能做些什麼才能正確地將此代碼移植到android?
感謝