How to intrude a 3D model

I have a glb model and I want to make a click event that when I click on the model the model gets intruded, if I am holding the mouse button it keeps getting intruded.

Is there a way to do that?

What do you mean by intruded? You can use Raycaster to select specific parts of a model - if you’d like clicking any part of the model to select the entire mode, you can put a reference to the parent model in .userData of each child.

I mean like, consider a sphere made of clay when u press the sphere with ur thumbs its surface gets pushed inside something like that.

In my gltf model I want to do the same when I click it the model is pushed into.

Is the model surface subdivided enough to allow such sculpting? As an example:

While mesh on the right has vertices dense enough to be sculpted on, the one on the left is too low poly to allow that. Your model would need to have a high density of vertices or you’d need to apply on-click face subdivision in your code, before moving the vertices.

Its way too subdivided.

any help would mean a lot as I am trying to get into this field.

I need exactly this thing: Scuplting

Yes.

Some time ago I made this: https://codepen.io/boytchev/full/eYxGyPG

Generally, you need to raycast from the pointer/mouse cursor, find a point on the mesh, then push all vertices in vicinity of this point.

Good luck with your project.

2 Likes

Three Mesh BVH, has an amazing sculpting example.

5 Likes