More actions
Add extended description |
No edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Stub}} | {{Stub}} | ||
{{Distinguish|Vectors (Global)|Matrices (Global)}} | {{Distinguish|Vectors (Global)|Vector|Matrices (Global)}} | ||
Vectors and matrices at their core are '''a set of numbers''' that represent something (e.g. a Vector3 could represent a position in the world.) | Vectors and matrices at their core are '''a set of numbers''' that represent something (e.g. a Vector3 could represent a position in the world.) | ||
Vectors are one-dimensional; for example, a {{Type|Vector3}} holds 3 numbers. Vectors are most commonly used for representing the position and rotation of things. | Vectors are one-dimensional; for example, a {{Type|Vector3}} holds 3 numbers. Vectors are most commonly used for representing the position and rotation of things. | ||
Matrices are two-dimensional. All matrices are square, so a {{Type|Matrix3}} is a 3 by 3 grid of numbers. Matrices are most commonly used to represent transformations of vectors. For more in-depth information, see [[Wikipedia: | Matrices are two-dimensional grids. All matrices are square, so a {{Type|Matrix3}} is a 3 by 3 grid of numbers. Matrices are most commonly used to represent transformations of vectors. For more in-depth information, see [[Wikipedia:Transformation matrix|the Wikipedia article on transformation matrices]]. | ||
== Vectors == | == Vectors == | ||
Many functions that take in a vector will also take in the same amount of numbers and internally convert it into a Vector. | Many functions that take in a vector will also take in the same amount of numbers and internally convert it into a Vector. | ||
Vectors come in 3 types: Vector2, Vector3, and Vector4. You can create a vector by using the global method <code>vec</code> as shown: | Vectors come in 3 types: Vector2, Vector3, and Vector4. The number refers to the size of the vector (Vector4 has 4 numbers, etc.) You can create a vector by using the global method <code>vec</code> as shown: | ||
* vec(x {{Type|number}}, y {{Type|number}}, z {{Type|number?}}, w {{Type|number?}}) | * vec(x {{Type|number}}, y {{Type|number}}, z {{Type|number?}}, w {{Type|number?}}) | ||
This method will return a vector based on how many arguments you input. | This method will return a vector based on how many arguments you input. | ||
Line 17: | Line 17: | ||
Matrices are a set of vectors, which are normally used to change where models are, how they look, etc. | Matrices are a set of vectors, which are normally used to change where models are, how they look, etc. | ||
== Navigation == | |||
[[Category:Types]] | [[Category:Types]] | ||
{{Navbox documentation}} | {{Navbox documentation}} |
Latest revision as of 12:14, 29 October 2024
Vectors and matrices at their core are a set of numbers that represent something (e.g. a Vector3 could represent a position in the world.)
Vectors are one-dimensional; for example, a Vector3 holds 3 numbers. Vectors are most commonly used for representing the position and rotation of things.
Matrices are two-dimensional grids. All matrices are square, so a Matrix3 is a 3 by 3 grid of numbers. Matrices are most commonly used to represent transformations of vectors. For more in-depth information, see the Wikipedia article on transformation matrices.
Vectors
Many functions that take in a vector will also take in the same amount of numbers and internally convert it into a Vector.
Vectors come in 3 types: Vector2, Vector3, and Vector4. The number refers to the size of the vector (Vector4 has 4 numbers, etc.) You can create a vector by using the global method vec
as shown:
This method will return a vector based on how many arguments you input.
Matrices
Matrices are a set of vectors, which are normally used to change where models are, how they look, etc.
Documentation | |||||
---|---|---|---|---|---|
Globals | |||||
APIs (Types) | |||||
Visuals (Types) | |||||
Other Types | |||||
Enums |