locked
Rotating Cube RRS feed

  • General discussion

  • Hi,


    ProgramID: TWQ550

    I wrote a small program to show that a rotating cube can be done with Small Basic. It draws just three edges, but the other 9 can easily be added. Use the keys a,s,w and z to rotate the cube.

    kind regards,

    Sunday, April 4, 2010 1:29 PM

All replies

  • rdohmen,

    Nice work.  I modified it slightly for your interest for the following reasons.

    1] To just use the event calls to set flags and do the main work in a sequential While("True") ..EndWhile loop.  If you have been following some of the threads in this Forum you will see doing the graphics directly from the Event call subroutine can cause problems.  While it works fine in your case, I could see from commented code in your program that you had considered this option, which in my opinion is the best approach to couple graphics and events.

    2] Also, the way I changed it (looking for key down and key up events) deals with the auto-repeat delay that the OS imposes when holding a key down.

    Import TWQ550-0

    Sunday, April 4, 2010 2:13 PM
  • very nice, that it is possible to get this smooth motion!
    Sunday, April 4, 2010 4:19 PM
  • Hi! Here is My version: TWQ550-2

    Now you can also move and zoom your cube and press many keys on same time


    Sorry My Bad English
    Sunday, April 11, 2010 7:10 PM
  • cool
    -Phillip
    Saturday, April 17, 2010 3:33 AM
  • Sorry to revive an old thread but here's my version:

    TWQ550-3

    Saturday, November 24, 2012 1:42 PM