Giter Site home page Giter Site logo

dmikushin / dice3d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mimami24i/jsdice

0.0 1.0 0.0 2.2 MB

3D dice engine for online table games in Javascript/HTML5

License: BSD 2-Clause "Simplified" License

JavaScript 91.37% HTML 8.63%
javascript canvas html5 html5-game dice-roller

dice3d's Introduction

Javascript 3D dice engine for online table games

Based on the original repository https://github.com/mimami24i/jsdice shown in the works in the blog post by the same author.

Dice is rendered using pre3d engine: http://deanm.github.com/pre3d/

Deployment

This example displays a static 3D dice:

<script type="text/javascript" src="ThirdParty/pre3d/pre3d.js" charset="UTF-8"></script>
<script type="text/javascript" src="ThirdParty/pre3d/pre3d_path_utils.js" charset="UTF-8"></script>
<script type="text/javascript" src="ThirdParty/pre3d/pre3d_shape_utils.js" charset="UTF-8"></script>
<script type="text/javascript" src="dice3d.js" charset="UTF-8"></script>
<script>
function makeDice()
{
	var canvas = document.createElement("canvas");
	canvas.width = window.innerWidth;
	canvas.height = window.innerHeight;

        var dice = document.getElementById("dice");
        dice.append(canvas);

	var dice3d = new midice3d.Dice(canvas, 0.9 /* scaling */);
  	dice3d.camFocLen = 0.7;
	dice3d.init();

	dice3d.draw(0, 3 /* dice top value */, 2 /* x offset */, 1 /* y offset */, false);
}
</script>
<body onload="makeDice()">
<div id="dice"></div>
</body>

License

Free to use under the BSD license.

Credits

[email protected]

dice3d's People

Contributors

dmikushin avatar mimami24i avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.