Third:
pick ground to add thinInstance.
The model flattened after copying has the same effect as the original model.
But there was a problem when calculating the matrix for effect display. It should be that the matrix calculation was wrong.
Calculating matrices is not my specialty, I hope you can help me

let worldMat = node.computeWorldMatrix();
let p1 = pickedCenter;
pickInfo.getNormal().scaleToRef(0, p1);
p1.addInPlace(pickInfo.pickedPoint);
worldMat.invertToRef(tmpMat);
BABYLON.Vector3.TransformCoordinatesToRef(p1, tmpMat, p1);
BABYLON.Matrix.ComposeToRef(scale, quat, p1, tmpMat);
let arr = blockAllocMatrix(node);
tmpMat.copyToArray(arr, arr.length - 16);
if (arr.length === 16) {
node.isVisible = true;
}
node.thinInstanceSetBuffer('matrix', arr, 16);

I’m not sure to understand, the model is correctly positionned where I click with the mouse?

If the problem is that the model is not centered at the mouse location, you should simply add a translation to the matrix, which would be half the dimension of the bounding box of the mesh.

all step 3 ,third is wrong, first second is ok.
The problem lies in the third step
set transformNode ceng0 to pickPosition,
All child nodes are displayed according to the display effect before copying.

I hope you can rewrite the code in step three based on explaining the principle, especially the matrix calculation part. This is not what I am good at. Please help me.

Hello! You can simplify your code a bit by using the following technique (unfortunately I’m not able to share a playground because it is not saving, possibly because of the length of the strMesh string)

The bakeTransformIntoVertices part is to bake all of the translations, scales, etc of the parts of the mesh so that doesn’t interfer with positioning, and with that, you just need the translation of the picked point relative to the origin to place your meshes.

Note that you can pass a big buffer and set a value to thinInstanceCount so that only the first thinInstanceCount instances of the buffer are taken into account.