Sign in to follow this  
Followers 0

Rubik's Cube

7 posts in this topic

..just as I thought I had a fair grip on AutoIT.. what an impressive job !

(er du tilfældigvis dansker ?)

I am just a hobby programmer, and nothing great to publish right now.

Share this post

Link to post
Share on other sites

I don't like Rubik's Cube because I'm too silly for it but nice work.

If you correct the perspective of the cube then it would look even better by dividing the x/y coordinates by a constants.



Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post

Link to post
Share on other sites

Myicq, Yes, I'm Danish.

UEZ, It would look better, but I also think it would complicate the calculations primary in TurnLayer.au3. To keep calculations simple there is used an orthographic projection (glOrtho()). The lines between the layers in the cube are parallel. In a proper perspective these lines would not be parallel. That would complicate the calculations.


Share this post

Link to post
Share on other sites

Fixed some errors in the Build menu.

Added a log to see the colors of all sides at one time:

Posted Image

Added updated zipfile in first post.

1 person likes this

Share this post

Link to post
Share on other sites

Because of an issue with double parameters in DllCall's in AutoIt when scripts are run as 64 bit programs some OpenGL functions are not working. In this example only a few functions uses double parameters: glOrtho, gluLookAt and gluProject. It's possible to make workarounds.

A solution is to use The Embedded Flat Assembler (FASM) UDF by Ward to create assembler code to call the functions. For details see first post section 1.7 in this example.

After the 64-bit workarounds were implemented there seemed to be a problem with glOrtho and gluLookAt. They work individually, but they do not work when both commands are used in the same script. This problem is solved by coding glOrtho in this way:


Func glOrtho( $left, $right, $bottom, $top, $zNear, $zFar )
    Local $m = $IDENTITY_MATRIX
    $m[0]  =  2 / ( $right - $left )
    $m[5]  =  2 / ( $top - $bottom )
    $m[10] = -2 / ( $zFar - $zNear )
    $m[12] =  - ( $right + $left ) / ( $right - $left )
    $m[13] =  - ( $top + $bottom ) / ( $top - $bottom )
    $m[14] =  - ( $zFar + $zNear ) / ( $zFar - $zNear )
    glMultMatrixf( $m )
In the documentation of glOrtho it appears that the function can be implemented in this way.

New zip added in the bottom of first post.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0