Name

set()

Examples
size(100, 100)
v = PVector(0.0, 0.0, 0.0)
v.set(20.0, 30.0, 40.0)
print(v.x)  # Prints "20.0"
print(v.y)  # Prints "30.0"
print(v.z)  # Prints "40.0"
size(100, 100)
v1 = PVector(20.0, 30.0, 40.0)
v2 = PVector(0.0, 0.0, 0.0)
v2.set(v1)
print(v2.x)  # Prints "20.0"
print(v2.y)  # Prints "30.0"
print(v2.z)  # Prints "40.0"
vvv = [20.0, 30.0, 40.0]
size(100, 100)
v = PVector(0.0, 0.0, 0.0)
v.set(vvv)
print(v.x)  # Prints "20.0"
print(v.y)  # Prints "30.0"
print(v.z)  # Prints "40.0"
Description Sets the x, y, and z component of the vector using three separate variables, the data from a PVector, or the values from a float array.
Syntax
.set(x, y, z)
.set(x, y)
.set(v)
.set(source)
Parameters
xfloat: the x component of the vector
yfloat: the y component of the vector
zfloat: the z component of the vector
xfloat: the x component of the vector
yfloat: the y component of the vector
vfloat: the y component of the vector
sourcefloat: list to copy from

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.