Matrix identity [AS 2] 
Klasa: Matrix
Kompatybilność: ActionScript 1.0, Flash 8+
Ustawia każda właściwość matrix na wartość, która transformuje klip filmowy lub geometryczny konstruktor, aby był on identyczny do oryginału.
Po wywolaniu metody identity(), wynikowy matrix ma podane właściwości: a=1, b=0, c=0, d=1, tx=0, ty=0.
W notacji matrix, identity matrix wygląda następująco:
 
Listing
import flash.geom.Matrix;
var mojMatrix:Matrix = new Matrix(2, 0, 0, 2, 0 ,0);
trace(mojMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
mojMatrix.rotate(Math.atan(3/4));
trace(mojMatrix.toString()); // (a=1.6, b=1.2, c=-1.2, d=1.6, tx=0, ty=0)
mojMatrix.translate(100,200);
trace(mojMatrix.toString()); // (a=1.6, b=1.2, c=-1.2, d=1.6, tx=100, ty=200)
mojMatrix.scale(2, 2);
trace(mojMatrix.toString()); // (a=3.2, b=2.4, c=-2.4, d=3.2, tx=200, ty=400)
mojMatrix.identity();
trace(mojMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
 
        	var mojMatrix:Matrix = new Matrix(2, 0, 0, 2, 0 ,0);
trace(mojMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
mojMatrix.rotate(Math.atan(3/4));
trace(mojMatrix.toString()); // (a=1.6, b=1.2, c=-1.2, d=1.6, tx=0, ty=0)
mojMatrix.translate(100,200);
trace(mojMatrix.toString()); // (a=1.6, b=1.2, c=-1.2, d=1.6, tx=100, ty=200)
mojMatrix.scale(2, 2);
trace(mojMatrix.toString()); // (a=3.2, b=2.4, c=-2.4, d=3.2, tx=200, ty=400)
mojMatrix.identity();
trace(mojMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
Dodano przez: divix  
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły 

:: Wymiana linków 
    
	Modowe inspiracje |
        Android Gry i Aplikacje |
        ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
        Logo dla firmy |
        Change Tires - Car Weather Forecast Reminder |
        Laminas: MVC Framework for PHP |
        IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS | 
        Katalog roślin |
        Programming articles: JAVA, PHP, C++, Python, JavaScript |
        Kancelaria Adwokacka Łukasz Huszno
        
    

 
  
				

 
                             
 


 
                        
 
		 
	