Help make a cylinder WebGL

hello I am French student currently carrying out our project of molecule modeling in 3D WebGL we need a method to display a cylinder.
Thank you enlighten us on this issue.

WebGL doesn’t have functions for generating cylinders - or any other specific geometric shape for that matter. You have to generate the vertices yourself…either in a modelling program (blender or 3DStudio or whatever) - or you generate the vertices using math. Probably, you’ll want to do it with math.

I suggest you start with one of the simple WebGL demos:

…if you look at the code carefully, you’ll see that it calls a JavaScript function called “makeBox” to make the cube. That code is in a library here:

There is also a “makeSphere” function. With a little creativity, I think you can figure out how to make a cylinder.

look at … inder.html