The Line3.set()
method of the Three.js library is used to set the start and end points of a Line3
object.
line.set( start, end )
start
- A Vector3
object representing the starting point of the line.end
- A Vector3
object representing the ending point of the line.undefined
const line = new THREE.Line3();
const start = new THREE.Vector3(0, 0, 0);
const end = new THREE.Vector3(10, 10, 10);
line.set(start, end);
In the above example, a new Line3
object is created, then the set()
method is used to set the start and end points to the specified Vector3
objects.
The set()
method is useful for quickly updating the start and end points of a Line3
object without having to manually set each value using the start
and end
properties.
Once the points have been set with set()
, they can be accessed using the start
and end
properties of the Line3
object.