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 4072 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!