Use the arrow keys or mouse to rotate. I looked at fyromaniac1's 3D cube project that Z-demensions helped with to figure out the custom block math code. I modified it and added velocity.
Credit to Eriquito360