-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblog_transforms_summary.html
43 lines (32 loc) · 4.43 KB
/
blog_transforms_summary.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gabor Makes Games</title>
<meta name="author" content="Gabor Szauer">
<link rel="stylesheet" type="text/css" href="css/shared.css"><link rel="stylesheet" type="text/css" href="css/navigation.css"><link rel="stylesheet" type="text/css" href="css/font-raleway.css"><link rel="stylesheet" type="text/css" href="css/font-oxygen.css"><link rel="stylesheet" type="text/css" href="css/font-worksans.css"><link rel="stylesheet" type="text/css" href="css/codepretty/skins/desert.css"><script type="text/javascript" src="js/codepretty/prettify.js"></script><script type="text/javascript" src="js/navigation.js"></script><!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=UA-96941899-3"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-96941899-3');</script> <link rel="stylesheet" type="text/css" href="css/blog.css">
</head>
<body onload="MainNavOnLoad();PR.prettyPrint();"> <div class="nav"> <ul class="menu"> <li class="logo"><a href="https://gabormakesgames.com">Gabor Makes Games</a></li> <li class="item"><a id="main-nav-active" href="blog.html">Blog</a></li> <li class="item"><a href="books.html">Books</a></li> <li class="item"><a href="https://github.com/gszauer/">Github</a></li> <li class="item"><a href="https://twitter.com/gszauer">@gszauer</a></li> <li class="toggle"><a href="#">Open Menu</a></li> </ul></div>
<div id="blog">
<div id="sidebar"><a class="sidebar-item sidebar-first sidebar-gap" href="blog.html">Back to blog</a></li><a class="sidebar-item sidebar-first" href="transforms.html">Transform Hierarchies</a></li><a class="sidebar-item" href="blog_transforms_matrices.html">Combining Matrices</a><a class="sidebar-item sidebar-tab" href="blog_transforms_matrix_getters.html">World Space Getters</a></li><a class="sidebar-item sidebar-tab" href="blog_transforms_matrix_setters.html">World Space Setters</a></li><a class="sidebar-item" href="blog_transforms_transforms.html">Combining Transforms</a><a class="sidebar-item sidebar-tab" href="blog_transforms_transform_world.html">World Space</a></li><a class="sidebar-item sidebar-active " href="blog_transforms_summary.html">Summary</a></li></div>
<div id="content">
<h1>Summary</h1>
<p>This blog post covered some of the basic considerations of a transform hierarchy, but this is by no means a comprehensive guide. We only coverd transforms represented by seperate components stored in vectors and quaternions. Godot for example, stores a transform as a <a href="https://github.com/godotengine/godot/blob/34c988cfa92f19c232b65990704816ba1c7d2622/core/math/transform.h#L42">basis matrix and an origin vector</a>. Depending on the context of what you are doing, a different storage strategy might be appropriate.</p>
<ul>
<li>Affine Transforms</li>
<li>Uniform Scale Transform</li>
<li>Non-Uniform Scale Transform</li>
<li>Transforms With Negative Scale</li>
</ul>
<p>These are not unique properties of a transform. For example, a transform can be non-uniform scale and negative scale at the same time.</p>
<p>When designing a transform class you should also take into consideration things like interpolation, animation and utility functions transforms should provide. Hopefully this blog provided a solid start to this, or at least helped to demonstrate some of the non obvious, potentially hidden complexity of handling object transforms in games.</p>
<h2>Concatination order</h2>
<p>What is the correct order to concatenate transforms? Is it parent then child, or child then parent? IE:</p>
<pre class="prettyprint linenums">Transform CombineTransforms(Transform parent, Transform child) {
// OR
Transform CombineTransforms(Transform child, Transform parent) {</pre>
<p>Almost all of the math i write concatenates right to left, so i do transform concatination in that order as well: <code>CombineTransforms(Transform child, Transform parent)</code>. I suggest following the conventions of the math library you are using.</p>
</div>
</div>
</body>
</html>