Based on HexGL by BKcore (MIT License)