icosahedron / hexasphere / geodesic sphere code/math
category: code [glöplog]
Hi,
did anyone create a proper math formula (code) for creating a sphere with only hexagons?
The ideas I've seen is that one can start from an icosahedron, subdivide it, but then, if I understand correctly, 12 points will have 5 edges which doesn't sound optimal if one wants this in a lower resolution...
Or is this even possible (the hexagon sphere that is)?
In either case this is over my head, and google doesn't give much so I thought if anyone knew about this, it would be interresting and helpful :)
did anyone create a proper math formula (code) for creating a sphere with only hexagons?
The ideas I've seen is that one can start from an icosahedron, subdivide it, but then, if I understand correctly, 12 points will have 5 edges which doesn't sound optimal if one wants this in a lower resolution...
Or is this even possible (the hexagon sphere that is)?
In either case this is over my head, and google doesn't give much so I thought if anyone knew about this, it would be interresting and helpful :)
so basically you want a football?
Quote:
Or is this even possible (the hexagon sphere that is)?
If you tile hexagons you get a plane. To make a sphere you need to combine hexagons and pentagons, in which case you get the classic football.
Ok, but at higher levels? Maybe the suggested subdivision approach is the best then... If hexagons and pentagons in combination is the only way to make a sphere..
What Tjoppen says!
+you must define "optimal" and "higher levels".
+you must define "optimal" and "higher levels".
Use a more brute force method:
generate random points over a sphere (sphere point picking)
for each point repel it a few times
generate random points over a sphere (sphere point picking)
for each point repel it a few times
3) tesselate it somehow =)
Yes, I solved this with subdivision of an icosahedron. Thx!
You created a sphere with only hexagons by subdividing a icosahedron? How did you manage to do that, without adding any pentagons?
xernobyl: i think you missed out an extra couple of steps.
"..."
"profit"
"..."
"profit"
surely there are enough whitepapers written about the somehow technique, right? :)
gargaj: well, from reading xernobyl's post i imagine that the "somehow" is an active area of research for him personally. i.e. he has a number of techniques implemented, done some comparisons and instrumentation, but hasnt decided on the best possible approach yet. i look forward to his paper with great interest because at first his approach looks completely and totally idiotic - so perhaps there's something new to be learned from the solution he comes up with.
i assume that because obviously nobody would be a dick enough to post a load of hot air onto a pouet thread to look clever when they actually have no fucking clue about what they are talking about. that never happens right? :)
i assume that because obviously nobody would be a dick enough to post a load of hot air onto a pouet thread to look clever when they actually have no fucking clue about what they are talking about. that never happens right? :)
even our dear friend Paul Bourke doesnt explain it!!!
Quote:
You created a sphere with only hexagons by subdividing a icosahedron? How did you manage to do that, without adding any pentagons?
Well, no-one said they had to be regular hexagons.
Code:
.
/|\
/ | \
/ | \
/ |_ \
/ | \
/ / \
/______/______\ repeat x20
Quote:
You created a sphere with only hexagons by subdividing a icosahedron? How did you manage to do that, without adding any pentagons?
no no, the pentagons are still there (even though one does not add them, they appear naturally when subdividing)... but it's a reasonable tradeoff (visually).
Care to share screenshots of your work?
Quote:
i assume that because obviously nobody would be a dick enough to post a load of hot air onto a pouet thread to look clever when they actually have no fucking clue about what they are talking about. that never happens right? :)
<3 <3 <3
Ohhhh just for the lulz (somewhat related to "you can't to it with hexagons only"):
Anyone able to triangulate a sphere-topology with valency 6 vertices ("regular") only? - degenerate triangles == cheating.
It's a riddle - jsyk.
I took a tetrahedron or octahedron in the past and subdivided it, depending on how much code size I had available.
indian code:
you can build dodecahedron by calculating centres of teh triangles.
next step is to build edges, i have not this list.
and building geodesic sphere is rocket science)
Code:
pi.f=3.14159;27
Dim x.f(12)
Dim y.f(12)
Dim z.f(12)
x(1)=0;Sqr(5)/2
y(1)=0
z(1)=Sqr(5)/2
For j=0 To 4
x(j+2)=Cos(j*72*pi/180)
y(j+2)=Sin(j*72*pi/180)
z(j+2)=0.5
x(j+7)=Cos((36+j*72)*pi/180)
y(j+7)=Sin((36+j*72)*pi/180)
z(j+7)=-0.5
Next j
x(12)=0
y(12)=0
z(12)=-Sqr(5)/2
Repeat
glClear_(#GL_DEPTH_BUFFER_BIT | #GL_COLOR_BUFFER_BIT);
glLoadIdentity_() ;Reset The Current Modelview Matrix
glTranslatef_(0,0,-6.0) ;Move Right 1.5 Units And Into The Screen 7.0
glRotatef_(rquad,3.0,-6.0,0.0) ;Rotate The Cube On X, Y & Z
glColor3f_(1.0,1.0,1.0)
Restore icosavert
glBegin_(#GL_TRIANGLES)
For i=0 To 19
; glColor3f_(i/19,0,0.0)
Read.b a
Read.b b
Read.b c
;glBegin_(#gl_lines);#GL_TRIANGLES);#GL_lines);
glColor3f_(0.0,0.0,1.0);
glVertex3f_(x(a),y(a),z(a))
glColor3f_(0.0,1.0,0.0);
glVertex3f_(x(b),y(b),z(b))
glColor3f_(1.0,0.0,0.0);
glVertex3f_(x(c),y(c),z(c))
; glEnd_()
Next i
glEnd_()
rquad=rquad-0.15
glFinish_()
SwapBuffers_ ( hDC );
Until ( GetAsyncKeyState_ (#VK_ESCAPE) )
DataSection
icosavert:
Data.b 1,2,3,1,3,4,1,4,5,1,5,6,1,6,2;ok 15
Data.b 2,6,11,3,2,7,6,5,10,5,4,9,4,3,8;ok 15
Data.b 5,9,10,6,10,11,4,8,9,3,7,8,7,2,11;15
Data.b 11,10,12,7,11,12,8,7,12,9,8,12,9,12,10;15
you can build dodecahedron by calculating centres of teh triangles.
next step is to build edges, i have not this list.
and building geodesic sphere is rocket science)
http://fly.cc.fer.hr/~unreal/theredbook/chapter02.html
icosahedron+algo.
icosahedron+algo.
Heh, I got lost in the icospheres... didn't end up with the hexagons in the end...
https://www.dropbox.com/s/2ilnt8cro2ydf5q/sphereworld.png
https://www.dropbox.com/s/2ilnt8cro2ydf5q/sphereworld.png
Nice!
If a circle is an infinite number of infinitesimal lines, a sphere is an infinite number of infinitesimal hexagons. Or regular sized hexagons, if it's an infinitely large sphere.
(None of that is actually true. Or is it?)
Maybe it's possible to 'construct a sphere' using a flat plane of hexagons and curved space (so the plane curves into a sphere)? Technically it wouldn't be a sphere at all, but it could look like one.
(None of that is actually true. Or is it?)
Maybe it's possible to 'construct a sphere' using a flat plane of hexagons and curved space (so the plane curves into a sphere)? Technically it wouldn't be a sphere at all, but it could look like one.
Not that it would help at all with the original question, unless you're going to generate the vertices per frame.