Sign in to follow this  
Freakdesign

modelling a Dodekaeder ?

Recommended Posts

Freakdesign    124
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
McCoy    226
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
sBibi    241
"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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this