creating an object using javascript

I want to create an object within given points on the plane. I want to know if this is possible using javascript…example i gave certain points that form a surface of a sphere, however, the object does not look like a sphere because the inside is hollow…to make it more visible, I want to create an object inside the sphere…

Note: The object I created is not a sphere…I just site a more understandable example

thank you…

@Berenger answered this as a comments, so I’m copying it here as an answer:

Game Object creation

Mesh runtime creation

Also, you can take a look at the procedural example project on the Unity site, which contains several examples of procedurally generating a mesh:

http://unity3d.com/support/resources/example-projects/procedural-examples.html