Matrix.RotatePrepend(Double) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在此結構前加一個指定角度 Matrix 的旋轉。
public:
void RotatePrepend(double angle);
public void RotatePrepend(double angle);
member this.RotatePrepend : double -> unit
Public Sub RotatePrepend (angle As Double)
參數
- angle
- Double
旋轉角度,要在前置。
範例
以下範例說明如何將旋轉置於 Matrix。
private Matrix prependRotateExample()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
// Prepend a 90 degree rotation about the origin.
// myMatrix is now equal to (15,20,-5,-10,25,30).
myMatrix.RotatePrepend(90);
return myMatrix;
}
private Matrix prependRotateAboutPointExample()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
// Prepend a 90 degree rotation about the
// point (100,100).
// myMatrix is now equal to (15,20,-5,-10,1025,2030).
myMatrix.RotateAtPrepend(90, 100, 100);
return myMatrix;
}
備註
在複合轉換中,個別轉換的順序很重要。 例如,如果您第一次旋轉,然後調整,然後轉譯,則得到的結果與第一次轉譯、旋轉、縮放結果不同。 其中一個原因是像旋轉和縮放這樣的轉換是相對於座標系統的原點完成的。 當縮放位於原點的物件時,結果會與縮放已從原點移動的物件不同。 同樣地,旋轉位於原點的 物件會產生與旋轉已移離原點的物件不同的結果。