Jump to content
  • Advertisement
Sign in to follow this  
golgoth

Creating a sphere with glDrawElements(GL_TRIANGLES...

This topic is 5017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! im trying to find some source code on how to create a sphere using glDrawElements(GL_TRIANGLES... all samples i ve found so far used glBegin... and/or incomplete regarding faces or quads creation!!! Thx

Share this post


Link to post
Share on other sites
Advertisement
First of all, OpenGL does have some built-in support for spheres. But, if you want to make your own, search for one of the recent threads on tesselating a sphere. It's not exactly trivial - it involves starting with an n-sided solid, and recursively subdividing the faces, then normalizing the resulting verts.

I've been using an octahedron, but I think there are other solids that yield more regular results, so I will probably switch. But an octrahedron is a good place to start.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!