• Advertisement
Sign in to follow this  

Making spheres

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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement