the x value of this vector. Default is 0.
the y value of this vector. Default is 0.
the z value of this vector. Default is 0.
Applies a Quaternion transform to this vector.
If this vector's x, y or z value is less than the min vector's x, y or z value, it is replaced by the corresponding value.
The minimum .x, .y and .z values.
The maximum .x, .y and .z values in the desired range If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value.
If this vector's length is less than the min value, the vector will be scaled up so its length is the min value.
The minimum value the length will be clamped to
The maximum value the length will be clamped to If this vector's length is greater than the max value, the vector will be scaled down so its length is the max value.
If this vector's x, y or z values are less than the min value, they are replaced by the min value.
The minimum value the components will be clamped to
The maximum value the components will be clamped to If this vector's x, y or z values are greater than the max value, they are replaced by the max value.
Calculate the dot product of this vector and v.
Sets this vector's .x, .y and .z values from the attribute.
The source attribute.
index in the attribute.
If index equals 0 returns the .x value. If index equals 1 returns the .y value. If index equals 2 returns the .z value.
0, 1 or 2.
Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
Computes the square of the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
Computes the Manhattan distance from this vector to v.
Computes the Manhattan length of this vector.
Convert this vector to a unit vector - that is, sets it equal to a vector with the same direction as this one, but .length 1.
Sets this vector from the cylindrical coordinates c.
array to store this vector to. If this is not provided a new array will be created.
optional offset into the array.
Returns an array [x, y, z], or copies x, y and z into the provided array.
Generated using TypeDoc
Class representing a 3D vector. A 3D vector is an ordered triplet of numbers (labeled x, y, and z), which can be used to represent a number of things, such as: A point in 3D space. A direction and length in 3D space. In three.js the length will always be the Euclidean distancee (straight-line distance) from (0, 0, 0) to (x, y, z) and the direction is also measured from (0, 0, 0) towards (x, y, z). Any arbitrary ordered triplet of numbers. There are other things a 3D vector can be used to represent, such as momentum vectors and so on, however these are the most common uses in three.js. Iterating through a Vector3 instance will yield its components (x, y, z) in the corresponding order. See the ngx3js docs page for details.
Examples
css3d / molecules | css3d / orthographic | games / fps | misc / animation / keys | physics / ammo / break
Code Example