Cairo: TCairoMatrix

Übersicht BlitzMax, BlitzMax NG Allgemein

Neue Antwort erstellen

Badudel

Betreff: Cairo: TCairoMatrix

BeitragMi, Apr 13, 2011 19:32
Antworten mit Zitat
Benutzer-Profile anzeigen
Hallo,

ich verstehe die CairoMatrix des Cairo-Moduls überhaupt nicht.
Folgendermaßen ist sie in der Hilfe beschrieben:

TCairoMatrix is used throughout cairo to convert between different coordinate spaces.

Soweit OK.

Doch die Init-Funktion verstehe ich gar nicht:

Zitat:
Method Init(xx:Double, yx:Double, xy:Double, yy:Double, x0:Double, y0:Double)
Description Sets matrix to be the affine transformation given by xx, yx, xy, yy, x0, y0.
Information The transformation is given by:
x_new = xx * x + xy * y + x0
y_new = yx * x + yy * y + y0

Parameters:

xx : xx component of the affine transformation.
yx : yx component of the affine transformation.
xy : xy component of the affine transformation.
yy : yy component of the affine transformation.
x0 : X translation component of the affine transformation.
y0 : Y translation component of the affine transformation.


Auch aus den Beispielen werde ich nicht schlau.

Kann mir jemand das erklären?

Vielen Dank,
Badudel
Wir werden dem Schwein schon schlachten, auch wenn ihm quiekt.
Zum Teufel mit das Grammatik!

Goodjee

BeitragMi, Apr 13, 2011 19:50
Antworten mit Zitat
Benutzer-Profile anzeigen
du kannst dich ja mal in matrizen einlesen, zb hier:

http://wiki.delphigl.com/index.php/Matrix

aber die umrechnungsvorschrift steht ja auch schon da:
Zitat:
x_new = xx * x + xy * y + x0
y_new = yx * x + yy * y + y0


x und y ist der vektor bzw punkt den du transformieren willst.

x0 und y0 werden also für verschiebungen benutzt.
xx xy yx und yy für rotationen oder skalierungen.

die normale einheitsmatrix ohne transformationen sieht dann so aus:
Code: [AUSKLAPPEN]
 1 0 0
 0 1 0


wenn du alles um faktor 2 skalieren wolltest würdest du statt 1 2 einsetzen Wink

für rotationen setzt du die werte xx, xy, yx und yy wie hier beschrieben: http://de.wikipedia.org/wiki/Drehmatrix unter Raum R^2

also wenn du nur eine matrix brauchst, benutz init(1,0,0,1,0,0) Wink
"Ideen sind keine Coladosen, man kann sie nicht recyclen"-Dr. House
http://deeebian.redio.de/ http://goodjee.redio.de/

Neue Antwort erstellen


Übersicht BlitzMax, BlitzMax NG Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group