Rubiks Cube?

66 views
Skip to first unread message

Sullivan Steele

unread,
Dec 12, 2016, 9:18:02 AM12/12/16
to Glowscript Users
I am attempting to create a Rubik's cube in with vpython. I want to give it a color for each side of each cube. Does anyone have any ideas on how to do this? The sides do not need to rotate. It is purely for making debugging easier and for visual pleasure.

Thank you in advance.

Bruce Sherwood

unread,
Dec 12, 2016, 9:29:31 AM12/12/16
to Glowscript Users
One way is to create a cube out of quads of different colors and then make a compound object from a list of the quads. You can then clone this compound object.



http://www.glowscript.org/docs/VPythonDocs/clone.html

Even simpler would be to make the compound from six thin boxes of different colors.

Murray Garth

unread,
Dec 12, 2016, 5:15:22 PM12/12/16
to glowscri...@googlegroups.com
Here is a VPython Rubik's cube, with rotating sides, that I wrote purely for the visual pleasure and mental challenge. It creates a list of 27 compound objects, each containing a dark grey cube and very thin coloured boxes as labels on appropriate sides.

http://www.glowscript.org/#/user/murray.garth/folder/Public/program/Rubik%27sCube

SPOILER ALERT: It is all finished and working. If you want the satisfaction of writing it yourself then don't look at the code.


--

---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Sherwood

unread,
Dec 13, 2016, 10:49:29 AM12/13/16
to Glowscript Users
Very pretty!

Reply all
Reply to author
Forward
0 new messages