Jump to content

Rubik's Cube


LarsJ
 Share

Recommended Posts

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.

Br,

UEZ

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

Selection of finest graphical examples at Codepen.io

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

Link to comment
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.

Lars.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 7 months later...

Because of an issue with double parameters in DllCall's in AutoIt 3.3.8.1 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 )
EndFunc
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.

Link to comment
Share on other sites

  • 8 months later...
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...