{"id":25,"date":"2013-09-28T20:27:04","date_gmt":"2013-09-29T02:27:04","guid":{"rendered":"http:\/\/mepem.com\/pemcode\/?p=25"},"modified":"2013-09-28T20:27:04","modified_gmt":"2013-09-29T02:27:04","slug":"3-transformations-i-linear-transformations-vector-matrix","status":"publish","type":"post","link":"https:\/\/mepem.com\/pemcode\/?p=25","title":{"rendered":"3. Transformations I: Linear Transformations (vector, matrix)"},"content":{"rendered":"<p>3. Transformations I: Linear Transformations. Multiple Transformations (2\/14) &#8230; vectors &amp; linear transformations (4&#215;4 matrices)<\/p>\n<p>Vector is length &amp; direction, can be represented as 2D (dx, dy) or 3D (dx, dy, dz).&#160; Add vectors adds components (visually attach tail to head).&#160; Subtract vector just add the negative (visually flip direction of minus vector).&#160; To compute the length, use pythagorean theorem.&#160; Unit vector is vector length 1, compute by dividing the vector by its length.<\/p>\n<p>Dot product A dot B = AxBx + AyBy + AzBz = cos(theta) * ||A|| * ||B||.&#160; Theta is the angle between A and B.&#160; ||A|| is magnitude of A.&#160; For unit vectors, A dot B = cos(theta).&#160; Because for unit vectors, ||A|| is 1 and ||B|| is 1.&#160; Dot product can tell you which side of a surface something is on.&#160; Example take the dot product of the Normal vector (to a plane) and the View vector (to the camera); the sign (greater than or less than zero) tells you if the angle is less than or greater than 90 degrees<\/p>\n","protected":false},"excerpt":{"rendered":"<p>3. Transformations I: Linear Transformations. Multiple Transformations (2\/14) &#8230; vectors &amp; linear transformations (4&#215;4 matrices) Vector is length &amp; direction, can be represented as 2D (dx, dy) or 3D (dx, dy, dz).&#160; Add vectors adds components (visually attach tail to head).&#160; Subtract vector just add the negative (visually flip direction of minus vector).&#160; To compute [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4,3],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.7.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mepem.com\/pemcode\/?p=25\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"3. Transformations I: Linear Transformations (vector, matrix) - Pem&#039;s Code Blog\" \/>\n<meta property=\"og:description\" content=\"3. Transformations I: Linear Transformations. Multiple Transformations (2\/14) &#8230; vectors &amp; linear transformations (4&#215;4 matrices) Vector is length &amp; direction, can be represented as 2D (dx, dy) or 3D (dx, dy, dz).&#160; Add vectors adds components (visually attach tail to head).&#160; Subtract vector just add the negative (visually flip direction of minus vector).&#160; To compute [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mepem.com\/pemcode\/?p=25\" \/>\n<meta property=\"og:site_name\" content=\"Pem&#039;s Code Blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-29T02:27:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mepem37\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mepem.com\/pemcode\/#website\",\"url\":\"https:\/\/mepem.com\/pemcode\/\",\"name\":\"Pem&#039;s Code Blog\",\"description\":\"Game Development, Graphics Programming, GPU, Computer Science\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mepem.com\/pemcode\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mepem.com\/pemcode\/?p=25#webpage\",\"url\":\"https:\/\/mepem.com\/pemcode\/?p=25\",\"name\":\"3. Transformations I: Linear Transformations (vector, matrix) - Pem&#039;s Code Blog\",\"isPartOf\":{\"@id\":\"https:\/\/mepem.com\/pemcode\/#website\"},\"datePublished\":\"2013-09-29T02:27:04+00:00\",\"dateModified\":\"2013-09-29T02:27:04+00:00\",\"author\":{\"@id\":\"https:\/\/mepem.com\/pemcode\/#\/schema\/person\/f608518805f74a09056a8d28a205237d\"},\"breadcrumb\":{\"@id\":\"https:\/\/mepem.com\/pemcode\/?p=25#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mepem.com\/pemcode\/?p=25\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mepem.com\/pemcode\/?p=25#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mepem.com\/pemcode\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"3. Transformations I: Linear Transformations (vector, matrix)\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/mepem.com\/pemcode\/#\/schema\/person\/f608518805f74a09056a8d28a205237d\",\"name\":\"mepem37\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/mepem.com\/pemcode\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7e8be16a457b4e26979bd95268bf1ec8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7e8be16a457b4e26979bd95268bf1ec8?s=96&d=mm&r=g\",\"caption\":\"mepem37\"},\"url\":\"https:\/\/mepem.com\/pemcode\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mepem.com\/pemcode\/?p=25","og_locale":"en_US","og_type":"article","og_title":"3. Transformations I: Linear Transformations (vector, matrix) - Pem&#039;s Code Blog","og_description":"3. Transformations I: Linear Transformations. Multiple Transformations (2\/14) &#8230; vectors &amp; linear transformations (4&#215;4 matrices) Vector is length &amp; direction, can be represented as 2D (dx, dy) or 3D (dx, dy, dz).&#160; Add vectors adds components (visually attach tail to head).&#160; Subtract vector just add the negative (visually flip direction of minus vector).&#160; To compute [&hellip;]","og_url":"https:\/\/mepem.com\/pemcode\/?p=25","og_site_name":"Pem&#039;s Code Blog","article_published_time":"2013-09-29T02:27:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"mepem37","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/mepem.com\/pemcode\/#website","url":"https:\/\/mepem.com\/pemcode\/","name":"Pem&#039;s Code Blog","description":"Game Development, Graphics Programming, GPU, Computer Science","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mepem.com\/pemcode\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mepem.com\/pemcode\/?p=25#webpage","url":"https:\/\/mepem.com\/pemcode\/?p=25","name":"3. Transformations I: Linear Transformations (vector, matrix) - Pem&#039;s Code Blog","isPartOf":{"@id":"https:\/\/mepem.com\/pemcode\/#website"},"datePublished":"2013-09-29T02:27:04+00:00","dateModified":"2013-09-29T02:27:04+00:00","author":{"@id":"https:\/\/mepem.com\/pemcode\/#\/schema\/person\/f608518805f74a09056a8d28a205237d"},"breadcrumb":{"@id":"https:\/\/mepem.com\/pemcode\/?p=25#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mepem.com\/pemcode\/?p=25"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/mepem.com\/pemcode\/?p=25#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mepem.com\/pemcode"},{"@type":"ListItem","position":2,"name":"3. Transformations I: Linear Transformations (vector, matrix)"}]},{"@type":"Person","@id":"https:\/\/mepem.com\/pemcode\/#\/schema\/person\/f608518805f74a09056a8d28a205237d","name":"mepem37","image":{"@type":"ImageObject","@id":"https:\/\/mepem.com\/pemcode\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/7e8be16a457b4e26979bd95268bf1ec8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e8be16a457b4e26979bd95268bf1ec8?s=96&d=mm&r=g","caption":"mepem37"},"url":"https:\/\/mepem.com\/pemcode\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/patRsd-p","_links":{"self":[{"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/posts\/25"}],"collection":[{"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":1,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mepem.com\/pemcode\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}