Jump to content
  • Advertisement
Sign in to follow this  

modelling a Dodekaeder ?

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

hi in my project i use huge 3d - constructs of spheres tiled in Quads i heard about Dodekaeder 3d-constructs and they match my goal a construct where all faces looks as the others actual i created a 64*64 mesh for each Quad of the sphere and thats the main problem... the spaces between points at the north/south pole are little, at equator the spaces are big if my objects are constructed as a Dodekaeder the spaces are all the same i need a formula which can create a spherevertexes like a dodekaeder or some good links to samples thx for help

Share this post

Link to post
Share on other sites
As you are from Germany I am hoping that you speak German, this site or this one.
They have some formulas that may help.

But if you are attempting to modle somthing like your left image it will not work as the quads must all be the same size, but the smaller your quads (i.e. each polygon having a smaller surface area) the more spherical it will be.

If using some API that will only use triangles this is the only (closest) way I know of. (English site)

[Edited by - McCoy on November 26, 2005 9:50:59 PM]

Share this post

Link to post
Share on other sites
"dodekaeder" seems to be the german word for dodecahedron ?
if that's the case, and unless I misunderstood your post, the left image isn't based from a dodecahedron. It's a subdivided icosahedron. (you could rebuild it starting from a dodecahedron, but it would be much more painful than subdividing an icosahedron).

and the faces aren't all exactly the same. they seem to be, but there are small differences/distortions. the icosahedron is actually the largest structure you can create in 3D that's made of identical equilateral triangles. (and that's 20 triangles)

you can grab an icosahedron's coordinates from paul bourke's platonic solids page

you can then subdivide it to get the left image (that would actually be subdivided twice with the algorithm below), with something more or less like:

while (subdivisions--)
for (f = 0; each triangle in the mesh; f++)
// grab original face's vertices
v0 = cur_mesh.faces[f].vertex[0];
v1 = cur_mesh.faces[f].vertex[1];
v2 = cur_mesh.faces[f].vertex[2];

// compute edge midpoints
m0 = (v0 + v1) * 0.5f;
m1 = (v1 + v2) * 0.5f;
m2 = (v2 + v0) * 0.5f;

// v0 m0 v1
// x----x----x
// \ / \ /
// \/___\/
// m2 \ / m1
// \ /
// "
// v2

// build new triangles
new_mesh.add_face(v0, m0, m2);
new_mesh.add_face(m2, m0, m1);
new_mesh.add_face(m1, m0, v1);
new_mesh.add_face(m1, v2, m2);

// final step, push back the vertex on the sphere's surface
for (each output vertex)
vertex = normalise(vertex) * sphere_radius;

swap(cur_mesh, old_mesh);

there are many ways to subdivide this, that's probably one of the most straightforward ones, but clearly not the fastest.
you could also directly subdivide in one go without iterating, and not be limited to multiple of two subdivision counts (as with the above algorithm), although it would be a little bit more complex, as you would have to take the sphere's curvature into account to avoid distortions when projecting vertices back onto the sphere surface, you also can stripify quite efficiently the output triangles if you wish, the subdivided structure being quite tristrips-friendly, etc...

[Edited by - sBibi on November 27, 2005 2:04:34 AM]

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!