{"id":4544,"date":"2015-12-21T17:33:37","date_gmt":"2015-12-21T17:33:37","guid":{"rendered":"http:\/\/anthroponaute.fr\/blog-informatique\/?p=4544"},"modified":"2016-02-10T18:20:56","modified_gmt":"2016-02-10T18:20:56","slug":"transformations-geometriques","status":"publish","type":"post","link":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/?p=4544","title":{"rendered":"Transformations g\u00e9om\u00e9triques des objets par les matrices"},"content":{"rendered":"<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4351\" src=\"https:\/\/anthropoya.cluster014.ovh.net\/blog-informatique\/wp-content\/uploads\/2015\/02\/1.gif\" alt=\"1\" width=\"262\" height=\"287\" \/><\/strong><\/p>\n<p><strong>Intro :<\/strong><\/p>\n<p>Les transformations g\u00e9om\u00e9triques op\u00e9r\u00e9es sur des objets 3D sont de 3 types : <strong>translation<\/strong>, <strong>rotation<\/strong> et mise \u00e0 l&rsquo;\u00e9chelle (<strong>agrandissement<\/strong>). Gr\u00e2ce \u00e0 ces trois transformations, on peut <strong>mettre un mouvement<\/strong> un ensemble de points (ou un mod\u00e8le).<\/p>\n<h4><span style=\"text-decoration: underline;\">Mais de quoi s&rsquo;agit-il ?<\/span><\/h4>\n<p>Une <em>translation<\/em> est un <strong>changement de position<\/strong> d&rsquo;un point ou de plusieurs points.<\/p>\n<p>Une <em>rotation<\/em> permet de faire <strong>pivoter un point<\/strong> (ou plusieurs points) autour d&rsquo;un axe par un certain angle.<\/p>\n<p>Une <em>mise \u00e0 l&rsquo;\u00e9chelle<\/em> permet d\u2019<strong>agrandir<\/strong> ou de <strong>diminuer<\/strong> la taille d&rsquo;un objet.<\/p>\n<p><strong>Pr\u00e9requis :<\/strong><\/p>\n<p>&#8211; Savoir ce qu&rsquo;est un <em>vecteur<\/em><\/p>\n<p>&#8211; Savoir ce qu&rsquo;est une <em>matrice<\/em><\/p>\n<p><strong>Explications :<\/strong><\/p>\n<p>Il existe <strong>deux mani\u00e8res<\/strong> de repr\u00e9senter un syst\u00e8me de coordonn\u00e9es : de type gauche ou de type droit.<\/p>\n<p><a href=\"https:\/\/anthropoya.cluster014.ovh.net\/blog-informatique\/wp-content\/uploads\/2015\/12\/sys_coord1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-4649\" src=\"https:\/\/anthropoya.cluster014.ovh.net\/blog-informatique\/wp-content\/uploads\/2015\/12\/sys_coord1.png\" alt=\"sys_coord\" width=\"360\" height=\"238\" srcset=\"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/wp-content\/uploads\/2015\/12\/sys_coord1.png 360w, https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/wp-content\/uploads\/2015\/12\/sys_coord1-300x198.png 300w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<p><strong>DirectX<\/strong> utilise un syst\u00e8me de coordonn\u00e9es de type <strong>droit<\/strong> tandis que <strong>OpenGL<\/strong> utilise un syst\u00e8me de coordonn\u00e9es de type <strong>gauche<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>On peut se servir des matrices pour repr\u00e9senter une transformation d&rsquo;un objet dans <strong>l&rsquo;espace de coordonn\u00e9es<\/strong> 3D.<\/p>\n<p><strong>L&rsquo;int\u00e9r\u00eat<\/strong> de la repr\u00e9sentation matricielle est principalement qu&rsquo;on peut <strong>combiner \u00e0 la suite<\/strong> n&rsquo;importe quelle transformation en une et seule matrice de transformation <strong>finale<\/strong>.<\/p>\n<p>Une transformation est une op\u00e9ration qui prend <strong>en entr\u00e9e<\/strong> un vecteur et qui en <strong>sortie<\/strong> le converti autrement.<\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"text-decoration: underline;\">Transformation lin\u00e9aire :<\/span><\/h4>\n<p>On pr\u00e9cise que <em>math\u00e9matiquement<\/em> une <strong>transformation<\/strong> (en l\u2019occurrence <strong>lin\u00e9aire<\/strong>) repr\u00e9sente :<\/p>\n<p>Soit la fonction <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctau%28v%29+%3D+%5Ctau%7B%28x+%2C+y+%2C+z%29%7D+%3D+%28x%5E%7B%5Cprime%7D%2C+y%5E%7B%5Cprime%7D%2C+z%5E%7B%5Cprime%7D%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\tau(v) = \\tau{(x , y , z)} = (x^{\\prime}, y^{\\prime}, z^{\\prime}) ' title='\\tau(v) = \\tau{(x , y , z)} = (x^{\\prime}, y^{\\prime}, z^{\\prime}) ' class='latex' \/><\/p>\n<p>respectant les propri\u00e9t\u00e9s suivantes :<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctau%28u%2Bv%29+%3D+%5Ctau%28u%29+%2B%5Ctau%28v%29+&#038;bg=ffffff&#038;fg=000000&#038;s=3' alt='\\tau(u+v) = \\tau(u) +\\tau(v) ' title='\\tau(u+v) = \\tau(u) +\\tau(v) ' class='latex' \/>\u00a0\u00a0 <strong>et<\/strong>\u00a0\u00a0 <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctau%28ku%29+%3D+k%5Ctau+%28u%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\tau(ku) = k\\tau (u) ' title='\\tau(ku) = k\\tau (u) ' class='latex' \/><\/p>\n<p>avec <img src='https:\/\/s0.wp.com\/latex.php?latex=%7Bu%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=3' alt='{u} ' title='{u} ' class='latex' \/> et <img src='https:\/\/s0.wp.com\/latex.php?latex=%7Bv%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='{v} ' title='{v} ' class='latex' \/> deux vecteurs\u00a0 \u00e0 3 composantes.<\/p>\n<p>Ces transformations sont nomm\u00e9es \u00ab\u00a0lin\u00e9aires\u00a0\u00bb car elles pr\u00e9servent <strong>l&rsquo;addition de vecteurs<\/strong> et la <strong>multiplication par un scalaire<\/strong>.<\/p>\n<p>Toutes les transformations lin\u00e9aires peuvent \u00eatre repr\u00e9sent\u00e9es par une <strong>matrice 3&#215;3 <\/strong>(ou plus).<\/p>\n<p>Pensez que les op\u00e9rations de <em>rotation<\/em> ou <em>d&rsquo;agrandissement<\/em> sont toutes des transformations lin\u00e9aires <strong>respectant<\/strong> ce dernier principe.<\/p>\n<p>Quant \u00e0 la transformation de <em>translation<\/em>, elle n&rsquo;est pas une transformation lin\u00e9aire mais une <strong>transformation affine<\/strong>.<br \/>\nUne transformation affine est une transformation lin\u00e9aire <strong>qui est suivie<\/strong> d&rsquo;une translation, elle <strong>pr\u00e9serve la colin\u00e9arit\u00e9<\/strong> des vecteurs (caract\u00e9ristique des vecteurs qui ont la m\u00eame direction). Ces derni\u00e8res sont peuvent \u00eatre repr\u00e9sent\u00e9es par une<strong> matrice 4&#215;4<\/strong>.<\/p>\n<p>On remarque que les matrices de rotation et d&rsquo;agrandissement <strong>sont aussi<\/strong>, par quant \u00e0 elles, des transformations affines !<\/p>\n<p>Pour s&rsquo;en servir, on <strong>multiplie <\/strong>un vecteur qui a besoin d&rsquo;\u00eatre transform\u00e9 par une matrice 4&#215;4 de translation. Ce dernier vecteur doit \u00eatre en notation \u00ab\u00a0<strong>homogeneous<\/strong>\u00a0\u00bb (voir l&rsquo;article sur les transformations de coordonn\u00e9es) pour \u00eatre multipli\u00e9 par une matrice 4&#215;4.<\/p>\n<p>L&rsquo;avantage de ces matrices affines, est qu&rsquo;elles peuvent <strong>\u00eatre combin\u00e9es les une \u00e0 la suite<\/strong> <strong>des autres<\/strong> en une seule matrice finale qui peut repr\u00e9senter la somme de ces transformations.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h4><\/h4>\n<h4><\/h4>\n<p>&nbsp;<\/p>\n<h4><span style=\"text-decoration: underline;\">La translation :<\/span><\/h4>\n<p>[sch\u00e9ma \/ dessin]<\/p>\n<p>Voici la matrice de transformation affine repr\u00e9sentant une translation :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BT%7D%28%5Ctextbf%7Bt%7D%29+%3D+%5Ctextbf%7BT%7D%28t_%7Bx%7D%2C+t_%7By%7D%2Ct_%7Bz%7D%29+%3D+%5Cbegin%7Bpmatrix%7D+1+%26+0+%26+0+%26+t_%7Bx%7D+%5C%5C+0+%26+1+%26+0+%26+t_%7By%7D+%5C%5C+0+%26+0+%26+1+%26+t_%7Bz%7D+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{T}(\\textbf{t}) = \\textbf{T}(t_{x}, t_{y},t_{z}) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; t_{x} \\\\ 0 &amp; 1 &amp; 0 &amp; t_{y} \\\\ 0 &amp; 0 &amp; 1 &amp; t_{z} \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{T}(\\textbf{t}) = \\textbf{T}(t_{x}, t_{y},t_{z}) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; t_{x} \\\\ 0 &amp; 1 &amp; 0 &amp; t_{y} \\\\ 0 &amp; 0 &amp; 1 &amp; t_{z} \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>Le vecteur <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7Bt%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{t} ' title='\\textbf{t} ' class='latex' \/> repr\u00e9sente la valeur de d\u00e9placement de la matrice.<\/p>\n<p>Pour changer la position d&rsquo;un vecteur <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> par cette matrice on fait :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=Translation+%3D+%5Ctextbf%7BT%7D%28%5Ctextbf%7Bt%7D%29p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='Translation = \\textbf{T}(\\textbf{t})p ' title='Translation = \\textbf{T}(\\textbf{t})p ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>L&rsquo;inverse de cette matrice (<strong>op\u00e9ration inverse<\/strong>) :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BT%7D%5E%7B-1%7D%28%5Ctextbf%7Bt%7D%29+%3D+%5Ctextbf%7BT%7D%5E%7B-1%7D%28t_%7Bx%7D%2C+t_%7By%7D%2Ct_%7Bz%7D%29+%3D+%5Ctextbf%7BT%7D%28-t_%7Bx%7D%2C+-t_%7By%7D%2C-t_%7Bz%7D%29+%3D+%5Cbegin%7Bpmatrix%7D+1+%26+0+%26+0+%26+-t_%7Bx%7D+%5C%5C+0+%26+1+%26+0+%26+-t_%7By%7D+%5C%5C+0+%26+0+%26+1+%26+-t_%7Bz%7D+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{T}^{-1}(\\textbf{t}) = \\textbf{T}^{-1}(t_{x}, t_{y},t_{z}) = \\textbf{T}(-t_{x}, -t_{y},-t_{z}) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; -t_{x} \\\\ 0 &amp; 1 &amp; 0 &amp; -t_{y} \\\\ 0 &amp; 0 &amp; 1 &amp; -t_{z} \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{T}^{-1}(\\textbf{t}) = \\textbf{T}^{-1}(t_{x}, t_{y},t_{z}) = \\textbf{T}(-t_{x}, -t_{y},-t_{z}) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; -t_{x} \\\\ 0 &amp; 1 &amp; 0 &amp; -t_{y} \\\\ 0 &amp; 0 &amp; 1 &amp; -t_{z} \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<h4><span style=\"text-decoration: underline;\">L&rsquo;agrandissement :<\/span><\/h4>\n<p>Une matrice d\u2019agrandissement permet de faire grossir ou de diminuer un mod\u00e8le.<\/p>\n<p>Voici la matrice de transformation affine repr\u00e9sentant une mise \u00e0 l&rsquo;\u00e9chelle :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BS%7D%28%5Ctextbf%7Bs%7D%29+%3D+%5Ctextbf%7BS%7D%28s_%7Bx%7D%2C+s_%7By%7D%2C+s_%7Bz%7D%29+%3D+%5Cbegin%7Bpmatrix%7D+s_%7Bx%7D+%26+0+%26+0+%26+0+%5C%5C+0+%26+s_%7By%7D+%26+0+%26+0+%5C%5C+0+%26+0+%26+s_%7Bz%7D+%26+0+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{S}(\\textbf{s}) = \\textbf{S}(s_{x}, s_{y}, s_{z}) = \\begin{pmatrix} s_{x} &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; s_{y} &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; s_{z} &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{S}(\\textbf{s}) = \\textbf{S}(s_{x}, s_{y}, s_{z}) = \\begin{pmatrix} s_{x} &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; s_{y} &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; s_{z} &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>Le vecteur <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7Bs%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{s} ' title='\\textbf{s} ' class='latex' \/> repr\u00e9sente la grandeur d&rsquo;agrandissement.<\/p>\n<p>&nbsp;<\/p>\n<p>Pour agrandir ou minimiser un vecteur <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> par cette matrice on fait :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=Agrandissement+%3D+%5Ctextbf%7BS%7D%28%5Ctextbf%7Bs%7D%29p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='Agrandissement = \\textbf{S}(\\textbf{s})p ' title='Agrandissement = \\textbf{S}(\\textbf{s})p ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>L\u2019inverse de cette matrice (<strong>op\u00e9ration inverse<\/strong>) :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BS%7D%5E%7B-1%7D%28%5Ctextbf%7Bs%7D%29+%3D+%5Ctextbf%7BS%7D%281%2Fs_%7Bx%7D%2C+1%2Fs_%7By%7D%2C+1%2Fs_%7Bz%7D%29+%3D+%5Cbegin%7Bpmatrix%7D+1%2Fs_%7Bx%7D+%26+0+%26+0+%26+0+%5C%5C+0+%26+1%2Fs_%7By%7D+%26+0+%26+0+%5C%5C+0+%26+0+%26+1%2Fs_%7Bz%7D+%26+0+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{S}^{-1}(\\textbf{s}) = \\textbf{S}(1\/s_{x}, 1\/s_{y}, 1\/s_{z}) = \\begin{pmatrix} 1\/s_{x} &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; 1\/s_{y} &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; 1\/s_{z} &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{S}^{-1}(\\textbf{s}) = \\textbf{S}(1\/s_{x}, 1\/s_{y}, 1\/s_{z}) = \\begin{pmatrix} 1\/s_{x} &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; 1\/s_{y} &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; 1\/s_{z} &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>Si\u00a0 <img src='https:\/\/s0.wp.com\/latex.php?latex=s_%7Bx%7D+%3D+s_%7By%7D+%3D+s_%7Bz%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='s_{x} = s_{y} = s_{z} ' title='s_{x} = s_{y} = s_{z} ' class='latex' \/> alors la matrice d\u2019agrandissement est dite \u00ab\u00a0uniforme\u00a0\u00bb.<\/p>\n<h4><span style=\"text-decoration: underline;\">La rotation :<\/span><\/h4>\n<p>Cette transformation op\u00e8re une rotation sur un vecteur avec un angle donn\u00e9 <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctheta+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\theta ' title='\\theta ' class='latex' \/> et autour d&rsquo;un axe donn\u00e9 <img src='https:\/\/s0.wp.com\/latex.php?latex=i+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='i ' title='i ' class='latex' \/><\/p>\n<p>La matrice de transformation affine sur l&rsquo;axe des x :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BR%7D_%7Bx%7D%28%5Ctheta%29+%3D+%5Cbegin%7Bpmatrix%7D+1+%26+0+%26+0+%26+0+%5C%5C+0+%26+%5Ccos+%5Ctheta+%26+-%5Csin+%5Ctheta+%26+0+%5C%5C+0+%26+%5Csin+%5Ctheta+%26+%5Ccos+%5Ctheta+%26+0+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{R}_{x}(\\theta) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; \\cos \\theta &amp; -\\sin \\theta &amp; 0 \\\\ 0 &amp; \\sin \\theta &amp; \\cos \\theta &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{R}_{x}(\\theta) = \\begin{pmatrix} 1 &amp; 0 &amp; 0 &amp; 0 \\\\ 0 &amp; \\cos \\theta &amp; -\\sin \\theta &amp; 0 \\\\ 0 &amp; \\sin \\theta &amp; \\cos \\theta &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>La matrice de transformation affine sur l&rsquo;axe des y est :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BR%7D_%7By%7D%28%5Ctheta%29+%3D+%5Cbegin%7Bpmatrix%7D+%5Ccos+%5Ctheta+%26+0+%26+%5Csin+%5Ctheta+%26+0+%5C%5C+0+%26+1+%26+0+%26+0+%5C%5C+-%5Csin+%5Ctheta+%26+0+%26+%5Ccos+%5Ctheta+%26+0+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{R}_{y}(\\theta) = \\begin{pmatrix} \\cos \\theta &amp; 0 &amp; \\sin \\theta &amp; 0 \\\\ 0 &amp; 1 &amp; 0 &amp; 0 \\\\ -\\sin \\theta &amp; 0 &amp; \\cos \\theta &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{R}_{y}(\\theta) = \\begin{pmatrix} \\cos \\theta &amp; 0 &amp; \\sin \\theta &amp; 0 \\\\ 0 &amp; 1 &amp; 0 &amp; 0 \\\\ -\\sin \\theta &amp; 0 &amp; \\cos \\theta &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>La matrice de transformation affine sur l&rsquo;axe des z est :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BR%7D_%7Bz%7D%28%5Ctheta%29+%3D+%5Cbegin%7Bpmatrix%7D+%5Ccos+%5Ctheta+%26+-%5Csin+%5Ctheta+%26+0+%26+0+%5C%5C+%5Csin+%5Ctheta+%26+%5Ccos+%5Ctheta+%26+0+%26+0+%5C%5C+0+%26+0+%26+1+%26+0+%5C%5C+0+%26+0+%26+0+%26+1+%5Cend%7Bpmatrix%7D+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{R}_{z}(\\theta) = \\begin{pmatrix} \\cos \\theta &amp; -\\sin \\theta &amp; 0 &amp; 0 \\\\ \\sin \\theta &amp; \\cos \\theta &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; 1 &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' title='\\textbf{R}_{z}(\\theta) = \\begin{pmatrix} \\cos \\theta &amp; -\\sin \\theta &amp; 0 &amp; 0 \\\\ \\sin \\theta &amp; \\cos \\theta &amp; 0 &amp; 0 \\\\ 0 &amp; 0 &amp; 1 &amp; 0 \\\\ 0 &amp; 0 &amp; 0 &amp; 1 \\end{pmatrix} ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>Pour faire pivoter un vecteur <img decoding=\"async\" class=\"latex\" title=\"p \" src=\"http:\/\/s0.wp.com\/latex.php?latex=p+&amp;bg=ffffff&amp;fg=000000&amp;s=2\" alt=\"p \" \/> par cette matrice on fait :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=Rotation+%3D+R_%7Bx%2Fy%2Fz%7D%28%5Ctheta%29p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='Rotation = R_{x\/y\/z}(\\theta)p ' title='Rotation = R_{x\/y\/z}(\\theta)p ' class='latex' \/>\n<p>&nbsp;<\/p>\n<p>L\u2019inverse de cette matrice (<strong>op\u00e9ration inverse<\/strong>) :<\/p>\n<img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BR%7D%5E%7B-1%7D%28%5Ctheta%29+%3D+%5Ctextbf%7BR%7D%28-%5Ctheta%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{R}^{-1}(\\theta) = \\textbf{R}(-\\theta) ' title='\\textbf{R}^{-1}(\\theta) = \\textbf{R}(-\\theta) ' class='latex' \/>\n<p>&nbsp;<\/p>\n<h4><span style=\"text-decoration: underline;\">Faire une rotation autour d&rsquo;un point quelconque : <\/span><\/h4>\n<p>[image \/ sch\u00e9ma avec un bonhomme]<\/p>\n<p>On remarque qu&rsquo;une rotation autour d&rsquo;un <strong>axe<\/strong> <img src='https:\/\/s0.wp.com\/latex.php?latex=i+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='i ' title='i ' class='latex' \/> d&rsquo;un point <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> ne <strong>change en rien la position<\/strong> du <strong>point<\/strong> <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> sur l&rsquo;axe <img src='https:\/\/s0.wp.com\/latex.php?latex=i+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='i ' title='i ' class='latex' \/>.<\/p>\n<p>En utilisant ce principe, on d\u00e9place le point <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> de fa\u00e7on \u00e0 ce qu&rsquo;il co\u00efncide autour de l&rsquo;origine : la matrice de translation <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BT%7D%28-p%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{T}(-p) ' title='\\textbf{T}(-p) ' class='latex' \/> le permet.<br \/>\nOn op\u00e8re ensuite la rotation sur l&rsquo;axe <img src='https:\/\/s0.wp.com\/latex.php?latex=i+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='i ' title='i ' class='latex' \/> par la matrice de rotation <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BR%7D%7B_i%7D%28%5Ctheta%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{R}{_i}(\\theta) ' title='\\textbf{R}{_i}(\\theta) ' class='latex' \/>.<br \/>\nFinalement le point <img src='https:\/\/s0.wp.com\/latex.php?latex=p+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='p ' title='p ' class='latex' \/> doit \u00eatre remis \u00e0 sa position initiale par la matrice de translation <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BT%7D%28p%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{T}(p) ' title='\\textbf{T}(p) ' class='latex' \/>.<\/p>\n<p>La transformation finale correspond \u00e0 cette \u00e9galit\u00e9 :\u00a0 <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Ctextbf%7BX%7D+%3D+%5Ctextbf%7BT%7D%28p%29%5Ctextbf%7BR%7D%7B_i%7D%28%5Ctheta%29%5Ctextbf%7BT%7D%28-p%29+&#038;bg=ffffff&#038;fg=000000&#038;s=2' alt='\\textbf{X} = \\textbf{T}(p)\\textbf{R}{_i}(\\theta)\\textbf{T}(-p) ' title='\\textbf{X} = \\textbf{T}(p)\\textbf{R}{_i}(\\theta)\\textbf{T}(-p) ' class='latex' \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>R\u00e9sum\u00e9 :<\/strong><\/p>\n<p>Nous avons pr\u00e9sent\u00e9 les matrices de transformations affines qui permettent de mouvoir les mod\u00e8les (ensemble de points \/ vecteurs d&rsquo;un objet \/ mod\u00e8le) \u00e0 travers la <strong>translation<\/strong>, la <strong>rotation<\/strong>, et la <strong>mise \u00e0 l&rsquo;\u00e9chelle<\/strong>.<\/p>\n<p><strong>R\u00e9f\u00e9rences :<\/strong><\/p>\n<p>&#8211; https:\/\/takinginitiative.files.wordpress.com\/2010\/08\/2.pdf<\/p>\n<p>&#8211; Shader Approach DirectX 9<\/p>\n<p>&#8211; Real Time Rendering &#8211; Third edition<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Intro : Les transformations g\u00e9om\u00e9triques op\u00e9r\u00e9es sur des objets 3D sont de 3 types : translation, rotation et mise \u00e0 l&rsquo;\u00e9chelle (agrandissement). Gr\u00e2ce \u00e0 ces trois transformations, on peut mettre un mouvement un ensemble de points (ou un mod\u00e8le). Mais de quoi s&rsquo;agit-il ? Une translation est un changement de position d&rsquo;un point ou de [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/posts\/4544"}],"collection":[{"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4544"}],"version-history":[{"count":81,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/posts\/4544\/revisions"}],"predecessor-version":[{"id":4944,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=\/wp\/v2\/posts\/4544\/revisions\/4944"}],"wp:attachment":[{"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.la-porte-des-nebuleuses.net\/blog-informatique\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}