

Four-coloring a Dodecahedron - jnotarstefano
http://jacquerie.github.com/

======
xentronium
Sorry, the controls are insane. I move mouse out to rotate the figure to see
the face I want to change color for, then I move mouse in and the dodecahedron
rotates again, moving the desired face back. Please, add some arrow controls
or something different from mouse movement to rotate.

Otherwise neat and hope you find a good internship.

~~~
jnotarstefano
I agree: it's barely usable as it is. I hacked it this very night, and those
were the best controls I was able to build. Thank you for playing and for the
critique!

~~~
krichman
You might also want to cull backwards polygons or use a depth buffer.

------
dietrichepp
The four-color theorem is typically formulated for planar figures. It also
applies to the surface of anything homeomorphic to a sphere, because a
stereographic projection will preserve the four-color property. It does not
apply to other shapes -- a simple torus may need seven colors. Adding holes
lets you increase the number of required colors without bound.

~~~
xentronium
Is there a statement for polyhedra similar to four-color theorem?

I could only google a book called "Map Coloring Polyhedra and the Four Color
Problem". Unfortunately, it's not available to read online. From what I've
found, it seems to me that there is only a handful of proven facts about
colorings of some polyhedra.

[ADD]: four color theorem works for every planar graph and it looks like one
can make such graph corresponding to any convex polyhedron, so it seems that
original OP statement holds.

~~~
Vvector
Just make a hole in the center of one side of the polyhedra. Then stretch out
the hole, flattening the polyhedra in the process. Eventually you get a planar
map, while retaining the same topology as the original polyhedra.

~~~
dietrichepp
Or, in math-speak, the polyhedron is homeomorphic to the sphere, and a
stereographic projection of the sphere will preserve the four-color property
while projecting the sphere to a plane.

I first thought, "That's exactly what I said," and then I realized that
"homeomorphic" isn't exactly a household word.

------
discountgenius
"It's harder than it looks" is talking about the mouse controls, right?

------
discountgenius
On my 1366x768 laptop in chrome, the dodecahedron covers some text. I had to
zoom out to read it.

~~~
jnotarstefano
This is a very serious blunder on my part! That's an important resolution to
support.

~~~
raimondious
The same happens for me at 1440x900.

------
Lutin
The problem is that your rotation is relative to the dodecahedron, not the
page, and that it uses inverted vertical rotation but not horizontal so it's
kind of hard to get used to IMO. I would also switch to movement when a user
clicks and drags as opposed to whenever they move the mouse.

------
deltasquared
Fun! Best of luck finding your internship.

As for the control, here is what I would do:

    
    
        Imagine a circle on the center of the screen that stopps the spin, outside the circle, rotate with a speed proportional to the distance from the center.

------
virtualritz
"It is harder than it looks" foremost because the usability of that coloring
app needs improvement.

------
mglinski
I tried it and almost couldn't solve it because of the weird acceleration. If
you are having this issue too, go into the dev console and change around the
MS_BTW_UPD variable. I personally like MS_BTW_UP=18

~~~
jnotarstefano
MS_BTW_UPD (which stands for "Milliseconds between updates") was changed to
18. Thank you for your feedback!

------
jferge
Really interesting mathematics I hadn't heard about before! The controls feel
a bit clunky, and clicking on a side doesn't change the color sometimes.

------
lewisreynolds
Great job, good to see people making stuff on here.

