{"id":2461,"date":"2016-07-04T10:48:46","date_gmt":"2016-07-04T14:48:46","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=2461"},"modified":"2021-12-09T04:50:53","modified_gmt":"2021-12-09T09:50:53","slug":"vectors-3d-math-game-programming","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/vectors-3d-math-game-programming\/","title":{"rendered":"3D Math for Game Programming: Vectors – Part 5"},"content":{"rendered":"\n
We now resume our series on 3D math for game programming from where we left off and talk about Vectors. In the last article of the series we took a look at Nested Coordinate Spaces<\/a> and learned how to specify them and handle coordinate space transformations.<\/p>\n\n\n\n Today we will be introducing you to vectors and how they are used in 3D Math for game programming<\/a>. This is a reminder that If you are new to this series you can go over and get started with the introduction to 3D Math for computer graphics here<\/a>.<\/p>\n\n\n\n When dissecting Vectors in the concept of 3D <\/a>Math then we need to distinguish between the two definitions in terms of abstract and purely mathematical definition and the geometric definition. And yes! We know geometry is part of math but work with us now. I am going somewhere with this. For the purposes of 3D math<\/a>, it is important to understand both implementations.<\/p>\n\n\n\n In mathematical terms, a Vector is a list of numbers or to us programmers, it is an array of numbers. Still in that same mood, as a mathematician, you must be able to distinguish between Vector vs Scalar<\/strong> quantities. A scalar quantity just to mention is an ordinary number. To illustrate, “velocity” and “displacement” are vector quantities, while “speed” and “distance” are scalar quantities.<\/p>\n\n\n\n The next term we introduce is “dimension”<\/strong>. Dimension is the value that tells us how many numbers a Vector has. Logic tells us that a Dimension is a number higher than zero. Therefore a single dimension Vector is also a Scalar or 1D Vector. We will mostly be looking at 2D, 3D, and 4D Vectors in this series. we will use x and y to refer to the elements in a 2D vector, x, y, and z to refer to elements in a 3D vector, and x, y, z, and w to refer to elements in a 4D vector.<\/p>\n\n\n\nWhat are Vectors<\/h2>\n\n\n\n
Now for the Geometric Definition of a Vector<\/h3>\n\n\n\n