{"id":1971,"date":"2023-05-18T22:13:07","date_gmt":"2023-05-18T22:13:07","guid":{"rendered":"https:\/\/writingagame.com\/?p=1971"},"modified":"2026-04-09T17:00:25","modified_gmt":"2026-04-09T17:00:25","slug":"opengl-where-is-the-front-where-is-the-back","status":"publish","type":"post","link":"https:\/\/writingagame.com\/index.php\/2023\/05\/18\/opengl-where-is-the-front-where-is-the-back\/","title":{"rendered":"OpenGL: Where is the front, where is the back?"},"content":{"rendered":"\n<p><strong>Tags:<\/strong> <em>OpenGL, OpenGL ES 3.2, 3D Graphics, Coordinate Systems, Right-Handed System, Geometry, Game Engine Development, C++<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>For 3D modeling, this is actually a non-trivial question.<\/p>\n\n\n\n<p>When we talk about humans, our natural assumption is that &#8220;right&#8221; is relative to the <strong>back<\/strong>, not the front. For example, what is to the right of your face is actually your <strong>left<\/strong> hand:<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/02.jpg\"><\/p>\n\n\n\n<p>The same logic applies to cars: the &#8220;right&#8221; side is determined from the driver&#8217;s perspective (facing forward):<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/03.jpg\"><\/p>\n\n\n\n<p>However, this creates a <strong>Left-Handed Coordinate System<\/strong>!<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/04.jpg\"><\/p>\n\n\n\n<p>A quick reminder just in case:<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/05.jpg\"><\/p>\n\n\n\n<p>The catch? <strong>OpenGL is Right-Handed.<\/strong><\/p>\n\n\n\n<p>Some could say: what a stupid decision to use right handed system?!<\/p>\n\n\n\n<p>Well\u2026 It is NOT &#8220;stupid&#8221;.<\/p>\n\n\n\n<p>In real life we use BOTH. For example, when looking at buildings, we rely on RIGHT handed system where the right side is to the right of the FRONT:<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/06.jpg\"><\/p>\n\n\n\n<p>Both systems work. For example, MS in their DirectX choose to use the left handed. But since we picked OpenGL, let&#8217;s follow ITS standard. So, correct orientation in our case would be:<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/writingagame.com\/img\/b03\/c06\/07.jpg\"><\/p>\n\n\n\n<p>Like for buildings, not like for cars or people.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"mb-2\">Tags: OpenGL, OpenGL ES 3.2, 3D Graphics, Coordinate Systems, Right-Handed System, Geometry, Game Engine Development, C++ For 3D modeling, this is actually a non-trivial question. When we talk about humans, our natural assumption is that &#8220;right&#8221; is relative to the back, not the front. For example, what is to the right of your face is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1973,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1971","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-side-notes"],"_links":{"self":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/comments?post=1971"}],"version-history":[{"count":10,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1971\/revisions"}],"predecessor-version":[{"id":4298,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/posts\/1971\/revisions\/4298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/media\/1973"}],"wp:attachment":[{"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/media?parent=1971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/categories?post=1971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.com\/index.php\/wp-json\/wp\/v2\/tags?post=1971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}