let geometry = new THREE.BoxGeometry(500, 500, 500);
scene.add(geometry);
let edgesGeometry = new THREE.EdgesGeometry(geometry);
scene.add(edgesGeometry);
let material = new THREE.LineBasicMaterial({ color: 0xffffff, linewidth: 2 });
scene.add(material);
let wireframe = new THREE.LineSegments(edgesGeometry, material);
scene.add(wireframe);
geometry.vertices[0].set(30, 100, 3);
geometry.verticesNeedUpdate = true;
geometry.vertices[1] = new THREE.Vector3(300, 300, 3);
geometry.verticesNeedUpdate = true;
camera.position.z = 1000;
renderer.render(scene, camera);
The code above does not update the vertex positions on the displayed cube.
To see the changed vertex positions of the cube on screen, you should apply the verticesNeedUpdate
method after updating the vertices in the geometry.