Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



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

What would be the best way to create a sphere, so as to model a planet and it moving in orbit

Share this post

Link to post
Share on other sites
Go to nehe''s opengl site (nehe.gamedev.net) and go to the tutorials. There is a tutorial on Quadratics somewhere from tutorial #10-20 and there you will learn how to make a sphere.

"Dammit! What the friggin hell is the problem????"
"Wait a second! I never called [insert function here]/used the variable [insert variable here]/remembered to [insert action here]! Hahaha!"
:: fixes mistake ::
:: presses f7 ::
:: no errors ::
:: presses ctrl+f5 ::

Share this post

Link to post
Share on other sites

void drawSphere(float radius,int slices,int stacks)
GLUquadricObj *sphereOb = gluNewQuadric ();
gluQuadricDrawStyle (sphereOb, GLU_FILL);
gluQuadricNormals (sphereOb, GLU_SMOOTH);
gluQuadricTexture (sphereOb, GL_TRUE);
gluSphere (sphereOb, radius, slices, stacks);

It would be more efficient to only allocate the sphereob once, not every time you call drawSphere, but you get the point hopefully.

Why does everyone post links to NeHe instead of answering questions round here? If you don't know the answer, don't bother answering. It's not like you need a tutorial to understand glu quadric objects anyway.


[edited by - benjamin bunny on May 31, 2002 7:33:53 PM]

Share this post

Link to post
Share on other sites

  • 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!