tag:blogger.com,1999:blog-5052387.post6728500685087771172..comments2020-08-08T08:49:03.628-07:00Comments on Blobs in Games: 3 Whys - what problem am I addressing?Amithttp://www.blogger.com/profile/12159325271882018300noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5052387.post-59276459725017823552016-10-24T10:01:35.693-07:002016-10-24T10:01:35.693-07:00Thanks aref! I agree, transformations are the main...Thanks aref! I agree, transformations are the main idea. The reason I wanted to start with game cameras is that I usually structure my pages to answer an immediate question (like "how do I make a scrolling map") to draw the reader in, then introduce a more general, more useful idea (like transformations, including chaining them together and inverting them), then show how the specific question they had fits into the more general way of thinking. <br /><br />I hadn't thought about the downsides of matrices; thanks for that list!<br />Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-54828789022356527032016-10-22T04:11:23.664-07:002016-10-22T04:11:23.664-07:00Great perspective! In my experience, it's not ...Great perspective! In my experience, it's not just the camera that needs transformations. In (transformationally) nontrivial games, there is a scene graph where nodes need transformations relative to one another. For example, the limb of an animal relative to the body. <br /><br />Also, making certain shapes, e.g. winding tubular structures or most anything with a Lindenmayer system, requires transformations, e.g. the branches of a tree relative to the trunk; the capillaries of a leaf relative to the leaf spine.<br /><br />Even in data visualization, multiple transformations are present, and some of them are in value space, some are in screen space (e.g. annotations) and some in both.<br /><br />So I believe it's best to think of transformations in general terms; nothing specific to the camera (sure you want to smoothly guide it etc. but math-wise, same thing as other transforms). In fact, the camera is as though the rest of the world moved around on some kind of manipulator arm, as when a child observes a maquette.<br /><br />Also, however versatile matrix transforms are, they're in many ways limited:<br /><br />1. They're limited to affine and perspective transformations; lines are preserved. Sometimes you need non-linear transformations, e.g. a magnifying lens or logarithmic scaling in a game or in dataviz, or simulating general relativity; discontinuities etc.<br />2. On rotation, they suffer from the gimbal lock problem, unlike quaternions<br />3. They use up considerable space (e.g. 4x4 number grid), more than quaternions<br />4. Simple matrix math can wreak havoc with numerical precision esp. on the GPU; sometimes the solution is to do scale and translate in separate steps (check out e.g. https://github.com/gl-vis/gl-scatter2d-fancy/pull/2/files#diff-134f4c4c8be9ad818d2ee31c034f109c)<br />5. Matrix multiplications aren't _necessarily_ faster than scale + transform (and perhaps rotate) because, often, many of the elements are zeros or ones, and a decent compiler can find a good approach anyway (and often, transforms aren't the bottleneck)<br />6. Matrix transforms are very regular but less intuitive to non-linalg folks than scale+transformarefhttps://www.blogger.com/profile/18004387149717223993noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-57466685938257523782016-09-06T15:26:44.037-07:002016-09-06T15:26:44.037-07:00I tried this before https://makc3d.wordpress.com/2...I tried this before https://makc3d.wordpress.com/2012/01/10/wtf-transformation-matrix/ not really sure if it helped anyonemakchttps://www.blogger.com/profile/03538272019944670130noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-45515842097669668012016-08-01T03:03:07.945-07:002016-08-01T03:03:07.945-07:00I agree. Problem are game cameras. I have knowledg...I agree. Problem are game cameras. I have knowledge of matrices and basic ideas about they are used in graphic design, but since I'm learning to make games the main problem I found are the cameras. I couldn't find the information I wanted to understand them, how coordinates are transformed, etc. Knowing that a matrix is used for transformations is nice, but if you don't undersntad how finally that's shown in the real world... is useless.<br />The problem is the game camera and I'm focouse the last days on them.<br />Just my opinion.<br />I appreciate your articles.Anonymousnoreply@blogger.com