• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

129 Neutral

About mabulous

  • Rank

Personal Information

  • Location
  1. link to original article: http://mabulous.com/understanding-and-interpreting-the-homogeneous-transformation-matrix-in-3d-space [color=rgb(85,85,85)][font=Tahoma]In 3D computer graphics it is common practice to describe positions and directions using [/font][/color]homogeneous coordinate vectors[color=rgb(85,85,85)][font=Tahoma] and [/font][/color]affine transformations[color=rgb(85,85,85)][font=Tahoma] (scaling, rotating, translating, shearing, or a combination of them) using 4x4 transformation matrices. While explaining certain aspects of these transformation matrices to a colleague, I noted that even though there are many articles available on the web which explain the setup of these matrices, most of them do not point out some very important high-level relations between the numbers in the matrix and the actual transformation they represent in 3D space.[/font][/color] [color=rgb(85,85,85)][font=Tahoma] After reading this article, you should understand these relations and be able to visualize an affine transformation simply by looking at the raw numbers of the matrix. Without going very general mathematically, this article is a high level discussion and will not explain what matrices are or how to perform computations with them. Before reading on you should:[/font][/color] [background=transparent]know what vectors and matrices are[/background] understand matrix*matrix and matrix*vector multiplications by performing a few of them on paper understand what a homogeneous coordinate vector is check your fridge (just to be sure) The setup of a 3D transformation matrix describing an affine transformation[color=rgb(85,85,85)][font=Tahoma] Most articles about 3D transformation matrices will show you something like this:[/font][/color] [color=rgb(85,85,85)][font=Tahoma] [/font][/color] [color=rgb(85,85,85)][font=Tahoma] While this is accurate, the formula above shows how to setup the rotational part of the transformation matrix using Euler angles. Not only are Euler angles evil (avoid them whenever possible), the relatively complex looking formula also obfuscates some much easier to comprehend and much more useful informations that can be read from it - so don't even try to memorize it.[/font][/color] [color=rgb(85,85,85)][font=Tahoma] Generally, an affine transformation in 3D space describes how to map the coordinates of any point from reference space A to reference space B and we represent this transformation using the 4x4 matrix T. So, if T for example is a "localToWorld" matrix, reference space A would be the local coordinate system (in which for example the vertex coordinates of a 3D mesh are defined) and reference space B would be the world coordinate system. Multiplying any local vertex coordinates with the localToWorld matrix thereby yields the coordinates of said vertex in world space and as such, T describes exactly how the 3D mesh is positioned, oriented and scaled in world space. The transformation is said to span A as a subspace of B, and it does so using the 3 basis vectors [color=rgb(255,0,0)][background=transparent][background=transparent]e[/background][size=2]x[/background][/color], [color=rgb(51,153,102)][background=transparent][background=transparent]e[/background][size=2]y[/background][/color], [color=rgb(51,102,255)][background=transparent][background=transparent]e[/background][size=2]z[/background][/color]:[/font][/color] [color=rgb(85,85,85)][font=Tahoma] [/font][/color][color=rgb(85,85,85)][font=Tahoma] And here's the catch: you can read these three basis vectors as well as the translation component directly from the 4 columns of the transformation matrix. They are expressed in terms of the target space the matrix maps to (so, in world space for the case of a localToWorld matrix).[/font][/color] [color=rgb(85,85,85)][font=Tahoma] Here is a sample application to illustrate this (you need to have the Unity3D Webplayer installed). Use the mouse to rotate, translate and scale the 3d model and observe how the values in the transformation matrix change. Also you can hover with the mouse over the transformation matrix to get some tool-tips:[/font][/color] [color=rgb(85,85,85)][font=Tahoma] http://mabulous.com/understanding-and-interpreting-the-homogeneous-transformation-matrix-in-3d-space[/font][/color] [color=rgb(85,85,85)][font=Tahoma] In the start configuration the transformation of the 3D mesh is aligned with the world coordinate system, which is why the three basis vectors of the transform equal the basis vectors of the world coordinate system. Rotate the model by about 45? around the Z axis by dragging at the blue circle and you may see something like this:[/font][/color][color=rgb(85,85,85)][font=Tahoma] [/font][/color][color=rgb(85,85,85)][font=Tahoma] So, visualizing this transformation by looking at the numbers does not require too much imagination anymore. The first column is your thumb, oriented in world space direction (0.7, 0.7, 0.0). The second column is your index finger, oriented in world space direction (-0.7, 0.7, 0.0). The third column is your middle finger, oriented in world space direction (0.0, 0.0, 1.0). The fourth column is the offset from the world origin to the base of your hand and since this example shows a left handed coordinate system, use your left hand to perform this exercise.[/font][/color] [color=rgb(85,85,85)][font=Tahoma] You can also scale the model by dragging one of the small circles. Observing the numbers in the matrix, you can see that scaling simply means changing the magnitude (length) of the basis vectors. The three numbers below the matrix show these magnitudes:[/font][/color][color=rgb(85,85,85)][font=Tahoma] [/font][/color][color=rgb(85,85,85)][font=Tahoma] Finally, this article covered a Left Handed 3D space that follows a column vector convention (which is the case for example for Unity3D). If your 3D package assumes row vectors (which is the case for example in XNA), the matrix needs to be transposed. So instead of columns, you would read the rows of the matrix to find the basis vectors. More on 3D space orientation, column vs. row vectors and column major vs. row major matrices will be posted soon.[/font][/color] [color=rgb(85,85,85)][font=Tahoma] If you found this article helpful and want to ask or add something, please do so in the comments![/font][/color]