Hi. My name is cubastic, and the goal of this project is to guide you through solving a Rubik's Cube, which is a puzzle where the goal is to get each face so that it only has one color.
the program starts out with a 3D Rub
ik's Cube. When we press the "from camera" button, the webcam starts up, and we're shown the camera output. First we shuffle the cube, so it's random and then we hold the cube up to the camera and it reads in the colors on the cube. We hit spacebar, make sure all the colors are correct, and then advance of the next fase On the left, a virtual cube is shown that models what the camera sees.
After pressing spacebar, we simply follow the direction that we seethe virtual cube rotating in and then log the next face. Once we log the sixth and final face of the cube, We hit the spacebar, and that cube is shown on screen. It corresponds to the cube that we have in real life. Okay,
so now I've input my cube. What's showing on the top right now is this. I'm going to orient it so I'm looking at the cube the same way that it's being shown to me on the screen.
I'll hit "guide through solution faster," and just follow along with the moves that are shown to me.
As I'm going along, you can see, along the top, there's some information about what i' m doing that the program is providing to me. Right now, I'm working on orienting the first layer. Let's pause for a second and look at the first layer which is yellow in this case.
We're doing the corners for the first layer now, one at a time. The idea is, as I'm going through this program, I can get a general idea of how the algorithm works to generate a solution, I can get familiar with those move sets that the algorithm uses. Since we're working with the white face now I'm going to flip the cube over so we can see what we're doing down here. It looks like we're pretty close to the solution.
We just have to get those last three edge pieces into place. and voila! The cube is solved, and the virtual cube is solved, and the statistics are logged about that solution. Anytime You mix up your cube and you can't figure out how to solve it, you can just input into this program and hit "guide through solution" and you should end up with a solved cube.
that's my term project. I hope you enjoyed it. Thanks for watching. All the rendering is done in Tkinter using the "create_ polygon" method and a rudimentary 3Dgraphics engine that I wrote. The shuffle function generates two hundredrandom moves and executes them very quickly. Along the top of the screen, there is information about what step of the solution we're currently executing. Along the bottom of the screen. the solution is written in standard cube notation, where a letter corresponds to front, up, left, right, down, or back, and an apostrophe indicates a counterclockwise rotation whereas a letter without an apostrophe is a clockwise rotation.
click and drag to rotate the cube and observe the solution from different vantage point. If we want to pause anytime during the solution we can do so, and resume play or step forward just one move at a time We can also reverse or step back one at a time.
Let's say we're walking through a solution and we fall behind a little bit; we can step back until the cube matches up with our physical cube. We can slow down if you're going through a guided solution this could be easier to keep up with and it has nicer, more fluid turns because there are more frames for each turn We can also speed up because I get bored of waiting for the cube to solve itself. So, that's pretty quick... wheeeee!
solve solve solve solve solve Ta da! The cube is solved. The stats button brings up information about all the solutions you've logged. If you click the "reset stats" button, it goes into the text file and clears it. Now, when I shuffle the cube and generate a new solution, the stats button shows the statistics for just that solution.
Comments
Post a Comment