Repulsive Dots

Lately I’ve been messing about in Godot, a framework for making video games (similar to Unity).

I wanted to make a 3D game. In my game, you live in a geodesic dome, and can’t go outside, because mumble mumble mumble poisonous atmosphere?.

A geodesic dome, I learned, is related to the icosahedron, or d20 from RPGs.

A simple dome is the top half of the icosahedron. As they get more complex, you divide each triangle into more and more smaller triangles.

Icosahedron getting more and more detailed. Geodesic domes are the top half of each sphere.
Icosahedron getting more and more detailed. Geodesic domes are the top half of each sphere.

So to make a nice geodesic dome, we could find one (I failed), make one in Blender (too hard), or use some math to generate one in Godot. And to do that math, we need to know the list of 20 icosahedron faces. Which basically just needs the list of the 12 vertices!

Now, obviously you could look up the vertices, but I thought of a more fun way. Let’s put 12 points on a sphere, make them all repel each other (think magnetically, I guess), and see where on the sphere they slide to. Maybe they will all be spaced out evenly in the right places. Well, here’s what it looks like:

So… kinda? It was certainly entertaining.

By the way, the correct coordinates for the vertices of an icosahedron inside a unit sphere are:

  • the top at (0, 1, 0)
  • the bottom at (0, -1, 0)
  • 10 equally spaced points around a circle. they alternate going up and down below the center line.
    (±1/√5, sin(angle), cos(angle)) [projected onto the sphere]
Tagged , ,

Hack-A-Day, Day 13: Blueprint Maker

Hack-A-Day is a challenge to try and finish 30 projects in 30 days in November.

Today I tried to write a tool to make a floorplan. You can try it here. As usual the source code is on github.

This was an ambitious project for one day, and I didn’t finish everything I wanted. My original goal was to support

  • drawing and erasing rectangles (done)
  • adding, editing, deleting, and moving text labels (not done)
  • adding, deleting, and moving icons (mostly not done)
  • autosave (done)
  • undo support (done)
  • zoom and pan (not done)
  • sharing finished projects (stretch goal, not done)

What I did do was pleasantly high-quality, and I made pretty good progress.

Tagged , ,

Hack-A-Day: Hack-A-TV-Guide

It’s no longer november, but I’m still doing a project a day. It’s an all-month hack-a-thon!

Yesterday’s project was Hack-A-TV-Guide (demo, source). It’s a TV Guide generated from Wikipedia. I got the idea from having written isrickandmortyout.com. Why not do the same thing, but for every show?

I’m going to call this one a flop. There’s a good version of this project, but I ran out of time. Basically all it does is display info about a show, which is not very useful.

Tagged , , , ,

Hack-A-Day: Hack-An-MMO

It’s november, and I’ve decided this month that I’m going to do 30 projects in 30 days. It’s an all-month hack-a-thon!

This is November 30th, so this will be the last project.

Today’s project is Hack-An-MMO (demo, source). It’s a small collaborative art RPG. You can draw people, places, and things to populate the tiny world. Have fun!

Tagged , , , ,