0

I have to draw the ceilling of my model, and it is in a half cylinder shape. I drew using a gluCylinder but as far as I read on the internet, it is not possible to get only half of it, isn't?

Could someone please help with some ideas to that?

The ceilling I have to modelling is like this one:

enter image description here

I'm using xcode, writing in C++, using GLUT lib.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
U23r
  • 1,653
  • 10
  • 28
  • 44
  • 1
    OpenGL renders points, lines, and triangles only. Everything else (although it may not look so) is tesselated into triangles. (It may appear round if either triangles are small enough or round surface is faked by shading/lighting.) So, that's your solution: Remember the math for the cylinder (with sine and cosine and such) and build a triangle mesh for your half cylinder roof. Here a similar Q/A for inspiration: [SO: where can I find source code of GluCylinder and the functions it calls](https://stackoverflow.com/a/13165945/7478597). – Scheff's Cat Mar 10 '19 at 08:01
  • 1
    Btw. this `gluCylinder()` function is really old. I would use the math but replace the fixed function pipeline calls by building a VAO/VBO/IBO and rendering with `glDrawElements()`. (Unfortunately, I don't know the rest of your program nor which OpenGL profile you're using.) – Scheff's Cat Mar 10 '19 at 08:03

0 Answers0