Jump to content
  • Advertisement
Sign in to follow this  
ajm113

How can I make a nice sphere with out a thousand lines of code?

This topic is 4163 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

Ok, for my first OpenGL project I want to make a outer space scene and I want to add in a sphere. I tried some other codes but they don't work that well can someone help me out?

Share this post


Link to post
Share on other sites
Advertisement
Try this:



#include <GL/glu.h>

GLUquadricObj *q //Initialization
q = gluNewQuadric();


//Rendering
gluSphere(q, radius, slices, stacks); //Radius is a float, slices and stacks are integers


//Deinitialization
gluDeleteQuadric(q);


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!