Jump to content
  • Advertisement

Archived

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

rk

Generating a 3D sphere

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

I need an algorithm for generating vertices for a 3D sphere, which has N segments and consists of triangular faces. I was able to generate some vertices that form a sphere of points, but I can''t figure out how to connect them to each other to create those triangles. Please, help me! I''m out of brainpower. rk

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mesa3d/Mesa/src-glu/quadric.c

Click on "view" (revision 1.9). The function gluSphere is the one you''re looking for.

Share this post


Link to post
Share on other sites
Thanks for the link, it''s great... except that the function uses the method GL_QUADSTRIP for rendering. And what I am looking for is more like triangle strip. You might think "but hey, he knows how to do it with quad strip, why couldn''t he just convert that to triangle strip?" It''s because I don''t find it a trivial task at all.

So in other words, I need more help!


rk

Share this post


Link to post
Share on other sites
You may want to look for a "geodesic" sphere generation routine. Try keywords in a search engine: geodesic, dome, sphere, tesselation, algorithm. A sphere tesselated using the geodesic style will be made of triangles of a uniform size and shape (actually, equilateral triangles) which can look much better (when rendered with textures/lighting----due to view-angle-independent symmetry) than a sphere tesselated into quads using the latitude/longitude style (as in the gluSphere approach).

If a tesselation gives triangles, but not tristrips, then you can send the triangles to a postprocessor such as nVidia''s NvTriStrip utility (see NVSDK on developer pages at www.nvidia.com) to generate tristrips.

Try doing a search on the GDAlgorithms list archives here:

http://www.geocrawler.com/lists/3/SourceForge/4856/0/"

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!