# Introducing VCUBE! [cube simulator]



## speedcuber50 (Sep 6, 2012)

VCUBE is my own cube simulator!

I made it when my old cube broke so that I still had a cube to play with until I got my new one (sorry, they were both those Rubik's things). It has full 3D graphics and turn animations. One other unique feature of the program is that it allows you to save the state of the cube and come back later. I've yet to make it save multiple states though... I thought it was really good.

Then, I added a better interface, so you no longer had to specify "Red clockwise, Green anticlockwise". Instead, you could say "Front clockwise, Left anticlockwise", and the program automatically worked out where front was depending on how you were holding the cube. Finally, I added the ability to solve itself, using a beginner's LBL method.

Currently, the program only simulates a 3x3 cube. I've thought about adding other sizes. A 2x2 would be easy (simply a 3x3, but don't display the edges and centres). A 4x4 would be more difficult, though, and I don't know how to solve it anyway. The other feature which I _was_ working on was a script function, so that it would be possible to develop an expandable cube platform for the whole community.

Users could write scripts which look for algorithims, count permutations, solve the cube using better methods, and even do sticker-by-sticker colour transformations! I was really looking forward to CubeScript, that is, until I got stuck on implementing the if...then construct in its simple language (if you could help me there, that would be nice).

Generally, I think VCUBE (Virtual CUBE) could be helpful to the whole community, particularly with CubeScript. It's not, however, available for download, but I might post a screenshot to whet your appitite. I may also release the source code sometime (it's in BBC Basic for Windows).

I even made a cool screensaver  !


----------



## Zarxrax (Sep 6, 2012)

If there is no link or download, whats the point in announcing it?
And you should probably name it something else, seeing as the Vcube name is already taken. That would only cause confusion.


----------



## speedcuber50 (Sep 6, 2012)

Here's the picture. I prepared it quicker than I thought!





Zarxrax said:


> If there is no link or download, whats the point in announcing it?
> And you should probably name it something else, seeing as the Vcube name is already taken. That would only cause confusion.


I thought it would be cool to announce anyway! I don't have a website, you see, so I can't put a link anywhere.

As for the name, what has the name "Vcube"? I didn't know it was taken.


----------



## Zarxrax (Sep 6, 2012)

The scripting part seems really interesting if you get it working.

And http://www.v-cubes.com/


----------



## speedcuber50 (Sep 6, 2012)

Oooops! Sorry, V-Cube, for using your trade mark. I'll call it, er, umm... suggestions please!


----------



## StachuK1992 (Sep 6, 2012)

[DO NOT MENTION REPORTING POSTS. JUST REPORT AND THAT'S IT. KTHX.]

OP, keep us posted. Change the name though; at least that's my suggestion.


----------



## googlebleh (Sep 7, 2012)

I'm also interested to see how the screensaver will turn out


----------



## KCuber (Sep 7, 2012)

VirCube?


----------



## cubernya (Sep 7, 2012)

I'd definitely be interested in this.

As others have said, VCUBE is a horrible name for it


----------



## balloon6610 (Sep 7, 2012)

How about VC simulator ?


----------



## Owen (Sep 7, 2012)

Yeah, that name will get you a cease and desist letter from the desk of Verdes.


----------



## PandaCuber (Sep 7, 2012)

Going for VC Cube Simulator


----------



## Kian (Sep 7, 2012)

PandaCuber said:


> Going for VC Cube Simulator



John McCain will have nightmares.


----------



## qqwref (Sep 7, 2012)

I'm gonna suggest naming it something that isn't so generic. If you call it something based off "virtual cube" then how will people remember the difference between this one and all the other dozens of virtual cube programs? Call it something based on a unique feature you will include, or on your name/username (but not speedcuber50, that's generic as well). Hell, you could even call it CubeScript 

Also, can you please switch to the common cube notation?  See http://www.speedsolving.com/wiki/index.php/3x3x3_notation


----------



## peterbone (Sep 7, 2012)

Looks good. Although the idea of saving the state to come back later isn't unique. Also, it looks difficult to turn the faces if you have to click the buttons (maybe I'm missing something). Much easier to drag layers with the mouse or use keyboard controls. Have a look at my simulator in my signature (yes, the name is far too generic also).


----------



## speedcuber50 (Sep 7, 2012)

qqwref said:


> Also, can you please switch to the common cube notation?  See http://www.speedsolving.com/wiki/index.php/3x3x3_notation


I have seen and do know cube notation. I thought that what I'd done was clear enough. CubeScript will support the use of standared cube notaion (except for cube rotations and double layer turns). I thought that how I had labeled the buttons was fairly simple-it would be easy enough to change anyway.

The way the button labels originated is actually quite intresting, I thought. It was from the days when they were all named with different colours. Then, they got renamed with side names when I changed that.


peterbone said:


> Also, it looks difficult to turn the faces if you have to click the buttons (maybe I'm missing something). Much easier to drag layers with the mouse or use keyboard controls. Have a look at my simulator in my signature (yes, the name is far too generic also).


You're right-you do have to click the buttons and it is a real pain. But for me, it's fine anyway, as the animation takes up the movement time, so I wouldn't be able to go any quicker anyway. I did try making it dragable, but that got too complicated-unfortunately, I can't test the colour of a point in a Direct3D frame-limitation of the language that I'm using. However, you can drag the cube to change the view angle (not when it's solving itself, though).

I never thought of adding keyboard control. I've tried some particular simulator on the net which uses keyboard controls, but I find it a real pain. Maybe just arrow keys? I might consider changing the conrol method after I've done CubeScript.

As for the name of the program-I've had lots of suggestions, but I think I'll settle on what I thought of last night-OpenCube. The reason I choose this is because I plan for the cube to become an open developement platform, especially with CubeScript and my idea of making it open-source. It also sounds rather hi-tech, a bit like V-Cube's website  !

CubeScript's comming along now. This got me back into it!

I've now got the loops looping and the conditions testing, so now all I need is some way to upload the first version (wtih a half page CubeScript specifications  ).


----------



## ben1996123 (Sep 7, 2012)

so... download link?

edit:


speedcuber50 said:


> I never thought of adding keyboard control. I've tried some particular simulator on the net which uses keyboard controls, but I find it a real pain. Maybe just arrow keys?



You find it a pain because you haven't practised it.


----------



## speedcuber50 (Sep 7, 2012)

Here's the download:

View attachment OpenCube.zip

Screensaver:

View attachment Virtual Cube.zip

I won't put the source up yet-it needs more comments anyway!


----------



## peterbone (Sep 10, 2012)

speedcuber50 said:


> You're right-you do have to click the buttons and it is a real pain. But for me, it's fine anyway, as the animation takes up the movement time, so I wouldn't be able to go any quicker anyway. I did try making it dragable, but that got too complicated-unfortunately, I can't test the colour of a point in a Direct3D frame-limitation of the language that I'm using. However, you can drag the cube to change the view angle (not when it's solving itself, though)


You don't need to test the colour where the screen was clicked. You've drawn the cube so you have the coordinates of all the cubelet faces in the screen space already. Use a point in polygon test to find which cubelet face was clicked. Compare the cursor drag direction to the 2 cube layer directions going through that facelet to work out the direction it should move. That's how I did it. It does get a little complex but the result is a very intuitive interface.


----------



## speedcuber50 (Sep 15, 2012)

In theory that should work, but that's only if you're doing the 3D drawing _yourself_. I'm getting Direct3D to do it for me, so I don't actually know the 2D coordinates of the faces. I only know the 3D coordinates in space, and I can't work them out myself. If I was using my own 3D drawing routines, then your idea would work. But then the colour test would work, anyway  .

P.S. Has anyone tried the download, and does it work?


----------



## speedcuber50 (Nov 1, 2012)

Sorry, a bit off-topic, but this needs a bump anyway  .

I made a Rubik's Cube for my vintage Macintosh (for those cubers who are also interested in old, 1990s, 680x0 Macintosh computers). It's not as feture-filled, but this is what it offers:
-Black-and-white display (uses dithering to produce "grey" shades)
-Logical oposite colours (inverted patterns are oposite, so it's easier to learn the arrangement of colours for quicker solving)
-Drag turning (there's no Direct3D, so I had to do the calculations myself, so I could follow my own variation on peterbone's suggestion)
-Slice turns
-Cube reorientation (hit the space bar before dragging)
-Orthographic projection (don't know/understand/too lazy to find out about two-point perspective drawing calulations)
-Scramble
-Reset
Not present:
-Load/Save
-Solve (it's not the same as reset; solve solves the cube, whereas reset pulls it apart and reassembals it correctly  )
-Accurate drag detection (sometimes it moves it the wrong way, and then you get puzzled as to why your alg didn't work out correctly)
-Timer
-CubeScript 

I might put the download up if I get round to it (I'll probably use MacBinary)...

Also, if you're into old Macs, check out the 68k Macintosh Liberation Army (I'm onlyonemac around there)...


----------

