This is a port of jsc3d