www.webdeveloper.com
Results 1 to 5 of 5

Thread: Random generator - Dice Roll with HTML5 canvas

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,252

    Random generator - Dice Roll with HTML5 canvas

    Hello

    What better than a dice to generate random numbers ?

    However, it is not very easy to roll a dice even with HTML5 canvas !
    Here is an essay which roll with drag and drop or touch and move...

    But before trying to roll it like a real Dice, I'd like to solve the problem of its shape which appears with a coloured background (see this page).

    Thank you for any comments or proposals.

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,252
    Without perspective effect, It's possible to draw something that roll and look like a dice !

    Next step, with perspective no more ellipses but many points...
    Attached Images Attached Images

  3. #3
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    776
    If you wrote that code, then I am very impressed.
    Unfortunately I am no good at 3D mathematics, or more advanced graphics in that case, to be of any help.

    I will eagerly watch your progress though.

    Good luck.
    JavaScript: Learn | Validate | Compact

  4. #4
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,252
    Thanks ! I wrote effectively that code...
    Its' not very complicated to rotate a cube in space (see the source of 2x2x2 cube).

    This Fascinating page give me the idea of this mini Rubik's cube. I intended to propose to solve each position (It's possible with 2x2x2 - See this page ) but it's to heavy with the canvas rolling cube.

    My project is now simply to roll a dice... I discover now that Dices are not only cubes, but at first spheres...

    EDIT : Opera and safari do not appreciate my last script.
    Last edited by 007Julien; 11-10-2013 at 05:27 PM.

  5. #5
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,252
    What about this new version ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles