# Making spheres

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

## Recommended Posts

Is there a function to make spheres? I am not using glut. If there is no function then how do i write my own? Greetzz Hyperion

##### Share on other sites
Hmm... if you're not using glut, you may want to start off learning about bezier Patches. This concept will allow you to make pseudo-curved surfaces.

Here's links to some good sites about Bezier Curves:

http://web.cs.wpi.edu/~matt/courses/cs563/talks/surface/bez_surf.html
- A bit dry, but fairly complete article about the subject

http://www.gamedev.net/reference/articles/article1584.asp
- A GameDev article about the subject

http://www.java-tips.org/other-api-tips/jogl/bezier-patches-nehe-tutorial-jogl-port.html
- This one is someone's Java-based example of how to implement Bezier Patches.

Once you're able to apply these Patches in your programming, to make a sphere you would generate four of these patches and arrange them so that they make up the four "quadrants" of the sphere.

You'll also, once you implement this functionality, be able to make pretty much any curved surface using one or more of these patches.

Let us know if you need any help with those! Hopefully this'll point you in the right direction. Indeed, I had the same question myself a few years ago. Unless you wander into the right topic in a forum or ask the right question to a teacher, you may never find out about Bezier patches. It took me by surprise back then. =)

EDIT: I should note that they are pseudo-curved only because you can't have a true curved surface on a visual device that renders in pixels... and knowing this, bezier curves are basically just recursively generated rectangles that, when small and frequent enough, emulate the appearance of a curve. A high enough level of recursion makes it almost impossible to detect the "squareness" of the curve by the human eye, at the expense of a severe loss in processing power. If I'm not mistaken, I believe that GLUT renders spheres (and other curved objects) in the exact same way.

##### Share on other sites
Assuming you didn't mean "glu" when you said "glut", you can use the gluQuadric functions:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=18

##### Share on other sites
thx for the great replys :D

##### Share on other sites
here a really good link

it explains you how to create a sphere or a subset of a sphere and how to texture it.

http://local.wasp.uwa.edu.au/~pbourke/texture_colour/spheremap/

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 13
• 52
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632967
• Total Posts
3009552
• ### Who's Online (See full list)

There are no registered users currently online

×