Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:51:59+00:00 2026-05-26T03:51:59+00:00

Are there any tutorials out there that explain how I can draw a sphere

  • 0

Are there any tutorials out there that explain how I can draw a sphere in OpenGL without having to use gluSphere()?

Many of the 3D tutorials for OpenGL are just on cubes. I have searched but most of the solutions to drawing a sphere are to use gluSphere(). There is also a site that has the code to drawing a sphere at this site but it doesn’t explain the math behind drawing the sphere. I have also other versions of how to draw the sphere in polygon instead of quads in that link. But again, I don’t understand how the spheres are drawn with the code. I want to be able to visualize so that I could modify the sphere if I need to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:52:00+00:00Added an answer on May 26, 2026 at 3:52 am

    One way you can do it is to start with a platonic solid with triangular sides – an octahedron, for example. Then, take each triangle and recursively break it up into smaller triangles, like so:

    recursively drawn triangles

    Once you have a sufficient amount of points, you normalize their vectors so that they are all a constant distance from the center of the solid. This causes the sides to bulge out into a shape that resembles a sphere, with increasing smoothness as you increase the number of points.

    Normalization here means moving a point so that its angle in relation to another point is the same, but the distance between them is different.
    Here’s a two dimensional example.

    enter image description here

    A and B are 6 units apart. But suppose we want to find a point on line AB that’s 12 units away from A.

    enter image description here

    We can say that C is the normalized form of B with respect to A, with distance 12. We can obtain C with code like this:

    #returns a point collinear to A and B, a given distance away from A. 
    function normalize(a, b, length):
        #get the distance between a and b along the x and y axes
        dx = b.x - a.x
        dy = b.y - a.y
        #right now, sqrt(dx^2 + dy^2) = distance(a,b).
        #we want to modify them so that sqrt(dx^2 + dy^2) = the given length.
        dx = dx * length / distance(a,b)
        dy = dy * length / distance(a,b)
        point c =  new point
        c.x = a.x + dx
        c.y = a.y + dy
        return c
    

    If we do this normalization process on a lot of points, all with respect to the same point A and with the same distance R, then the normalized points will all lie on the arc of a circle with center A and radius R.

    bulging line segment

    Here, the black points begin on a line and “bulge out” into an arc.

    This process can be extended into three dimensions, in which case you get a sphere rather than a circle. Just add a dz component to the normalize function.

    normalized polygons

    level 1 bulging octahedron
    level 3 bulging octahedron

    If you look at the sphere at Epcot, you can sort of see this technique at work. it’s a dodecahedron with bulged-out faces to make it look rounder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any tutorials or guides out there that anyone knows of that will
are there any tutorials out there how to scaffolding a simple model that uses
Anyone know of any good up to date tutorials out there that show how
are there any tutorials out there on how to create a sandbox using C#?
Is there any good tutorial or code snippet out there on how to use
I'm fairly sure you can create screensavers with.NET but are there any tutorials on
Are there any good tutorials out there to develop a selectable TreeView in Visual
I've got an SVG image with 67 separate paths. Are there any libraries/tutorials out
Are there any decent tutorials for setting up F# in Visual Studio 2005? Everything
Are there any documents/tutorials on how to clip or cut a large image so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.