Drawing sphere with PSPGL?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
gambiting
Posts: 154
Joined: Thu Aug 17, 2006 5:39 pm

Drawing sphere with PSPGL?

Post by gambiting »

Hi! Do you know if it's possible to draw a sphere using PSPGL?? gluSphere is not implemented,and I don't have any idea how to draw it manually - if you have any ideas please share.Thanks :D
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You google for "opengl examples sphere". :)

Here's a page with some examples showing how to draw a sphere using just triangles in opengl: http://www.sulaco.co.za/tut.htm

You'll notice that it starts by drawing an icosahedron with 20 triangles. Doesn't look very sphere-like. Then they show how to subdivide those triangles to make a much nicer looking sphere (example 2.7). Then finally a recursive subdividing example for a much nicer sphere (ex 2.8).

It's not C, but it's easy enough to follow what they're doing. There are other example pages you'll find in the search, but that was the first I noticed with a pretty simple sphere-via-triangles example.
Post Reply