Proportional Editing

hey team,

currently we have gizmo which select the whole mesh, with gizmo we could move/scale/rotate whole selected mesh, I was wondering if we could have option to select an edge/face or vertex in mesh and move its position. something like proportional editing in blender, actually what it does is, we can select vertex in mesh and move its position and all near by vertex move with it, for example below image.

Thanks <3

ofc you can :slight_smile:
you just have to code a gizmo to edit vertices of a mesh instead of mesh.position/scale/rotation.

// Arrays of these data can be fetched using;
let arr = mesh.getVerticesData(kind); 
// kind = position, normal, uv, etc, check mesh api docs
// the data can then be edited/changed in the array arr[index] = ...
// and put back into the mesh
mesh.setVerticesData(kind, arr);

Thanks @aWeirdo , but that’s what confusing part for me, to select the vertex in mesh with mouse and perform all the woodoo math on all nearby vertex.

so you can use default picking, compare pick.pickedPoint (vector3) to mesh vertices data and apply changes as you want before putting it back into the mesh.

made an example for you to play around with, here:

I hope it makes sense :slight_smile:

To try and match your screenshot (kinda),

It will lerp between 0 & “editAmount”, based on distance between pickedPoint & vertex, while within “maxDist”

if distance from pickedPoint to a vertex is 0, it will be changed by the full “editAmount”,
if distance is half of “maxDist”, it should be changed by half of “editAmount”
and so on.

1 Like

That’s very helpful @aWeirdo, that scalar class is amazing, but still I wants to see a gizmo, specially 2 gizmos Position and Rotation on specific area…long road for me :upside_down_face: