Using a objects 4x4 matrix how to map a plane of different segmentation to form spherical “segment”?

So I ask this question a while back and prinsoer849 give me just what I needed. https://codepen.io/prisoner849/full/ZEaVzvX .Here is an example of how you can bend planes of different segmentation to form a spherical “segment”:

But now my problem evolved where I’m using instanceMesh. I know that to scale, rotate, and transform an instanceMesh I must use a dummy object3D for a particular instance and pass its matrix to the instanceMesh. But what I don’t know how to do is project/map a plane onto a sphere as a segment using just the object3D 4x4 matrix. I know I have to make all the vertices the same distance away from some point. But I don’t know how to do it with just a 4x4 matrix, my linear algebra isn’t that good.

thanks