How to reshape the mesh real time?


If I create a box, and I want to reshape it to be longer or width more , how can I perform in code without scale it ?
And I wish to get the index of the point and set ( x,y,z ) to it like three.js.

if (dragging && currentIndex !== null) {
    raycaster.ray.intersectPlane(plane, planePoint);
    geometry.attributes.position.setXYZ(currentIndex, planePoint.x, planePoint.y, planePoint.z);
    geometry.attributes.position.needsUpdate = true;

any way to code it ? @will


Not my area but the voxel canvas project here creates meshes in realtime. You may be able to find some clues/ideas here on how to modify vertices there:


Does this help?

This uses the pc.createMesh function.

This is a utility function that creates a pc.Mesh structure for you (that essentially contains all the vertex data).

The code for that function is here:

You can create/edit any mesh in a similar fashion.


yes, I have found it , and render a new mesh every time. this did help me! thanks.