Question

How to make a sphere

Asked by: mattososky

I want to make a sphere mesh. I want the sphere to be a collection of symetrical flat faces. The is, the sphere is made up of some number of polygons, all of which are the same size.

Please give a really good explantional (mathmatical) about how this is done.

thanks,
Matthew

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-06-19 at 13:48:48ID23500483
Tags

sphere mesh

Topics

3D Graphics Software

,

C++ Programming Language

,

Math & Science

Participating Experts
4
Points
500
Comments
29

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Sphere
    Alright what I want to do may or may not be possible, that's what I'm trying to find out. I have had little luck finding anything on the net about this, so here goes. Would it be possible to draw a 3D sphere (as in full 3D) in JavaScript, in for example a <div> element...
  2. Translucent Sphere
    Anybody can guide in how to draw a translucent sphere? Pls show my some code. Thanks.
  3. Making sphere in photoshop
    I need to make a "3d" sphere out of a flat photoshop drawing. It would be for print use. How do I do it? ALSO would Illustrator be a better choice for making 3-d spheres? TO FURTHER CLARIFY, The exisitng photoshop/illustrator artwork consists of a flat circle ...
  4. sphere mesh texture map using MDX
    hello, how can i wrap a given texture to my sphere mesh in direct x? i tried using the code in the 'Applying Textures part 3 (ZMan)' article ( http://msdn.microsoft.com/coding4fun/zman/zmantextures3/default.aspx ) but it didnt work. can you please show me some code and make...
  5. Illustrator: Spheres
    I'm not really a graphics artist, per-se, but I've done a bit of web design so I've dabbled with my fair share of graphics. In the past, I've used things like Photoshop and Fireworks, but I believe what I needed to use for a recent project is Illustrator, so I've been using a...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: d-glitchPosted on 2008-06-19 at 14:07:11ID: 21826478

What you are asking may not be possible.

There are the Platonic Solid (regular polyhedra)
         http://mathworld.wolfram.com/PlatonicSolid.html

The most spherical is probably the duodecahedron (12 pentagons)


Then there are the Archimedean Solids (semi regular)
       http://mathworld.wolfram.com/ArchimedeanSolid.html

The most spherical is probably the soccer ball, but it uses two different polygons.

 

by: d-glitchPosted on 2008-06-19 at 14:10:45ID: 21826512

The Soccer Ball is properly called a Truncated Icosahedron
      http://mathworld.wolfram.com/TruncatedIcosahedron.html

You can approximate a sphere with other polygons (triangles for exampe), but you can not guarantee that they will be the same size or shape.  In fact, you can guarantee that they won't be.

 

by: d-glitchPosted on 2008-06-19 at 14:14:57ID: 21826561

Take a look at the Geodesic Dome:
     http://mathworld.wolfram.com/GeodesicDome.html

How close an approximation to you need??

 

by: ozoPosted on 2008-06-19 at 14:17:07ID: 21826580

 

by: mattososkyPosted on 2008-06-19 at 14:32:00ID: 21826693

It would be really convienent if all the faces were the same. Since that's apprentent not possible, the goal would be to limite the variation and number of faces as much as possible. Using the 'soccer-ball' method, it is possible to use the two shapes, a pentagon and hexagon without variying the face size, and using any number of faces?

 

by: d-glitchPosted on 2008-06-19 at 14:54:39ID: 21826870

No.  You can't add more faces to the soccer ball.

You can add faces to a geodesic dome, but not an arbitrary number.

What are you trying to do??

 

by: mattososkyPosted on 2008-06-19 at 15:03:30ID: 21826916

programming a scene where I am representing a planet. I want to be able to move for and away from the planet and have a good representation of varying terrain.

The real trick is the transition between being far enough out that the suface of the sphere has no relief, and coming to the point where it starts to. The logical way I see to handle this is to create a spehere made up of large number of flat surfaces, each of which has its own relief pattern. When the camera is close enough to an individual surface the relief of that surface, and a nunder of the surrounding ones, will become visible, this will act as a smooth transition to the surface of the planet.

In order to do this, I need to be able to break the surface of this planet up into roughy equal sections that are mapped.

 

by: d-glitchPosted on 2008-06-19 at 15:11:20ID: 21826956

Going back to geodesic domes:

Take the first triangulation of the duodecahedron:

I believe when you can replace each pentagon with five identical triangles.
So the sphere can be covered with 60 identical triangles.
The triangles are indentical, but isosceles not equilateral.

So in the next step, when you replace each triangle with three smaller triangles, they will not be identical.  You will need 180 triangles, but only two different shapes.

It gets worse from there, but that is quite a good approximation to a sphere.

Does it have to be better than that??

 

by: anmalaverPosted on 2008-06-19 at 15:15:35ID: 21826974

Hi

A question: What engine are you using?
If you're using OpenGL you can use MipMaps to achieve this kind of effect with gluBuild2DMipmaps, and you prefer, you could use gluSphere to generate the mapping coords automatically...

Just to think about...

Bye

 

by: mattososkyPosted on 2008-06-19 at 15:18:56ID: 21826992

the duodecahedron will not work. It's way too far from sphereical.

I need to formula which allows me to stipulate a variable number of surfaces which make up the sphere.

The geodesical dome might work, except the sufaces seem to be highly variable in size, which will not work either.

 

by: mattososkyPosted on 2008-06-19 at 15:19:59ID: 21826998

I do not want a api specific solution, nor do I want to achieve the effect with texturing.

 

by: anmalaverPosted on 2008-06-19 at 15:24:47ID: 21827026

Ok...

So try using geodesic dome, and if you want to use different detail levels, i suggest you to use Octrees, to achieve a good performance.

http://www.gamedev.net/reference/articles/article1485.asp
http://en.wikipedia.org/wiki/Octree

 

by: d-glitchPosted on 2008-06-19 at 15:45:08ID: 21827139

You have a sphere.  You know how big it is.

So you can find the area:   A = 4 * Pi * r²


You know how many faces you want: Call it n.
So take N equilateral triangles (or squares, or pentagons, or octogons) each with area  A/n.

Start pasting them on the sphere.  They won't fit perfectly.
When you're done, you'll have to tweak everything.
You will probably wind up with a lot of different shapes.

 

by: mattososkyPosted on 2008-06-19 at 15:52:05ID: 21827160

what do you mean, 'alot of different shapes'?  You specify using the ~ N equilateral triangles (or squares, or pentagons, or octogons) each with area  A/n.

this method might over strictly using a slight overlap, if I use a sufficant number of faces. I'll have to try it.

 

by: ozoPosted on 2008-06-20 at 04:24:09ID: 21829966

starting with a triangles from an icosahedron like
[
[[0,-1,$p],[0,1,$p],[$p,0,1]],
[[0,-1,$p],[0,1,$p],[$p,0,-1]],
[[0,-1,-$p],[0,1,-$p],[-$p,0,1]],
[[0,-1,-$p],[0,1,-$p],[-$p,0,-1]],

[[-1,$p,0],[1,$p,0],[0,1$,p]],
[[-1,$p,0],[1,$p,0],[0,-1,$p]],
[[-1,-$p,0],[1,-$p,0],[0,1,-$p]],
[[-1,-$p,0],[1,-$p,0],[0,-1,-$p]],

[[$p,0,-1],[$p,0,1],[1,$p,0]],
[[$p,0,-1],[$p,0,1],[-1,$p,0]],
[[-$p,0,-1],[-$p,0,1],[1,-$p,0]],
[[-$p,0,-1],[-$p,0,1],[-1,-$p,0]],

[[0,1,$p],[1,$p,0],[$p,0,1]],
[[0,1,-$p],[1,$p,0],[$p,0,-1]],
[[0,-1,$p],[1,-$p,0],[$p,0,1]],
[[0,-1,-$p],[1,-$p,0],[$p,0,-1]],
[[0,1,$p],[-1,$p,0],[-$p,0,1]],
[[0,1,-$p],[-1,$p,0],[-$p,0,-1]],
[[0,-1,$p],[-1,-$p,0],[-$p,0,1]],
[[0,-1,-$p],[-1,-$p,0],[-$p,0,-1]],
]
where
$p=(1+sqrt 5)/2;
you can subdivide them triangles with vertices at
$p = $p0*sin((1-$t0)*$w)+$p1*sin((1-$t1)*$w)+$p2*sin((1-$t2)*$w);
$p = $p/sqrt($p · $p);
where $w = arccos((1+sqrt 5)/sqrt(20+8*sqrt 5));
for 3 t values of the form
($t0,$t1,$t2) = (i/n,j/n,(n-i-j)/n))
($t0,$t1,$t2) = (i+1)/n,j/n,(n-i-j-1)/n)
($t0,$t1,$t2) = (i/n,(j+1)/n,(n-i-j-1)/n)
where 0 <= i+j < n,
or
($t0,$t1,$t2) = (i/n,j/n,(n-i-j)/n))
($t0,$t1,$t2) = (i-1)/n,j/n,(n-i-j+1)/n)
($t0,$t1,$t2) = (i/n,(j-1)/n,(n-i-j+1)/n)
where 0 < i+j <= n
and ($p0,$p1,$p2) = one of the above triangles


 

by: d-glitchPosted on 2008-06-20 at 13:29:43ID: 21834665

Here is a more organized way to cover the sphere:

You have a sphere.  You know how big it is.
So you can find the area:   A = 4 * Pi * r²

You know how many faces you want: Call it n.
So take N squares with area  A/n.

The edge dimension of each square is  s = sqrt( A/n).

Put a belt of squares around the equator.

You will need approximately   K  =  nint( 2 * Pi * r / s)  squares.

Adjust the dimensions slightly so that they fit and have the same area.

Work your way toward the poles.  You will need approximately K rows.

Because of symmetry, you will only need approx K/2 distinct shapes.
Most of the shapes will be spherical trapezoids.

When you get near the polar cap, you can switch to either a single regular polygon or set of triangles (pie slices).

 

by: mattososkyPosted on 2008-06-20 at 13:48:21ID: 21834804

d-glitch, this is the way most sphere mesh creating programs work, when you say you will only have k/2 shapes, this is true. But for a well defined sphere, it would be well into the hunders.

Again, one patter would be best (I realize not possible); two patters is very doable, at three we are getting into looking for a completely different way of accomplishing this. Having 10's of different shapes (or more) is not an option.

 

by: ozoPosted on 2008-06-20 at 14:04:27ID: 21834911

> I need to be able to break the surface of this planet up into roughy equal sections
How roughly equal to they need to be?
Would the triangles generated by http:#a21829966 be close enough?
If not it may be possible to tweak them to be a little closer.
Would you prefer to allow a slight distortion of the sphere to make the triangle
areas slightly closer?

 

by: mattososkyPosted on 2008-06-20 at 14:13:36ID: 21834964

(ozo) they need to be sections that I can map definitions to. If every one of them is difference (or lots of them a difference, then I need alot of definitions and thats not going to work.

I am still considering your technical post. I can't just look at that and understand what you saying, I'm going to need to plug that into code. May take a little while but i'll get to it.

Maybe another way to state the problem would be this. Is it possible to break up the sphere, not into a group a flat polgons, but a group of polygons which represents part of the curvature.  A hemisphere would be an example of this. How far down can that concept be taken?

 

by: ozoPosted on 2008-06-20 at 14:20:31ID: 21835017

 

by: ozoPosted on 2008-06-20 at 14:37:22ID: 21835129

here's a close to uniform tesselation
http://public.lanl.gov/ringler/files/2001.11.01.EOS.pdf

 

by: mattososkyPosted on 2008-06-20 at 15:06:31ID: 21835294

The concept of the  Dodecahedral Sphere looks very promising. Please give me some time to consider it.

 

by: NovaDenizenPosted on 2008-06-23 at 07:55:29ID: 21846857

Just start with any platonic solid (cube is easy), then recursively tessellate the faces until you have the approximation you want.

 

by: NovaDenizenPosted on 2008-06-23 at 07:57:14ID: 21846873

After tesselation, all the faces will be congruent isoceles triangles.  However, I'm not sure if that meets your 'symmetrical' requirement.

 

by: ozoPosted on 2008-06-23 at 10:02:16ID: 21848132

after tessellation, the faces will be only approximately congruent.

 

by: NovaDenizenPosted on 2008-06-23 at 10:14:17ID: 21848221

Wait, you're right.  When an isosceles triangle is tesselated, you get 2 congruent triangles and another triangle different from the first two.

 

by: mattososkyPosted on 2008-06-23 at 10:43:41ID: 21848465

What  a pain this is. While some of these solutions definately fit the bill of the original problem I proposed, the solution will only really work if there the polygons that make up the surface of the sphere are similar in shape and orientation.

I think I'm going to try a difference approach. I will construct a algorithm that build a sphere mesh in the traditional method, as a series of elipsodial rectacngles with a triangle fan at both poles. This is not what I really wanted, but I think it will be easier to map the elipsodial rectangles to a 'map' than to try to map triangles of different orientations to a map.

Everyone who contributed to this solution will get credit.
Thanks!

 

by: mattososkyPosted on 2008-06-23 at 10:45:47ID: 31468967

Thanks for the input!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...