vector - How to find the appropriate rotation of a pentagon for fitting into a LibGDX hex-tessellated sphere? -


i've got tricky question today involves lot of vectors. i'm trying keep them straight. have shape (mostly hexagons 12 pentagons): http://i.imgur.com/wdswecf.jpg

and want place 12 pentagon meshes 12 spots. start creating 12 meshes @ origin (the center of shape) , using following code rotate , move them position.

        (int = 0; < 12; ++i) {           vector3 pentpoint = pentpoints.get(i); // center of each pentagon.           modelinstance pent = pents.get(i);            vector3 direction = (pentpoint).cpy().sub(new vector3(0, 0, 0))                 .nor();           direction.set(direction.x, direction.y, direction.z);           pent.transform.settorotation(vector3.y, direction);           pent.transform.settranslation(pentpoint);} 

now, need. results in this: http://i.imgur.com/ch5jhb8.jpg. forgetting scaling now, can see pentagon rotated improperly. doesn't line slot. know can fix rotation using pent.transform.rotate(vector3.y, *value*); based on value each pentagon. problem is, have no idea how can calculate value should be.

can or point me resources? alternatively, use fact know coordinate of every vertex in shape fill in these pentagons drawing triangles using libgdx's modelbuilder. think less performant positioning .objs. thoughts?

i don't know library you're using, maybe can geometry. 1 approach draw mesh 1/5 of 1 of pentagons. suggest in place, rather @ origin. need know 2 adjacent vertices of pentagon. that, can calculate center of pentagon (i can supply formulas if wish). 3 points have determine triangle "fundamental domain" rotation group of dodecahedron. if have mesh on fundamental domain, can propagated other 4/5 of pentagon chose repeating 72 degree rotation axis through origin determined center of pentagon. call rotation a. can represent axis angle, quaternion, whatever.

to propagate mesh other pentagons in figure, need 1 more rotation: 180 degree rotation takes chosen pentagon nearby pentagon. again, give formula axis if like, if can find center of second pentagon information have, axis determined midpoint of segment connecting 2 centers. (you may have normalize point determining axis, depending on how represent rotations.) call 180 degree rotation axis rotation b.

rotation , b generate entire 60 element rotation group of icosahedron, allow propagate mesh on fundamental domain every other pentagon in figure. if you're not careful, however, may hit parts twice , others not @ all. think can in order: start fundamental domain. 4 a's fill in first pentagonal face (let's call north pole). b map pentagon adjacent pentagon. 4 more a's fill in meridian of pentagons. b take pentagon on meridian other meridian. 4 more a's fill in second meridian. b map pentagon on second meridian south pole.

the orientations of pentagons correct in procedure.

does help?


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -