Sets the vector's x
, y
, and z
components.
set()
can use separate numbers, as in v.set(1, 2, 3)
, a p5.Vector object, as in v.set(v2)
, or an array of numbers, as in v.set([1, 2, 3])
.
If a value isn't provided for a component, it will be set to 0. For example, v.set(4, 5)
sets v.x
to 4, v.y
to 5, and v.z
to 0. Calling set()
with no arguments, as in v.set()
, sets all the vector's components to 0.
Examples
Syntax
set([x], [y], [z])
set(value)
Parameters
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.