GithubHelp home page GithubHelp logo

jtsaich / beast-chessboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtiscione/chessboard3js

0.0 0.0 0.0 4.49 MB

WebGL chessboard library w/ AKCB

License: Other

JavaScript 94.69% CSS 1.96% HTML 3.35%

beast-chessboard's Introduction

chessboard3.js - A 3D JavaScript Chess Board

chessboard3.js is a standalone JavaScript chess board based on WebGL that mirrors the API of the widely used chessboard.js 2D board library by Chris Oakman. It is designed to be a drop-in replacement for chessboard.js and should run with any existing client code that currently uses chessboard.js to display a 2D board.

Like its 2D analogue, chessboard3.js is a "dumb board" with no AI or move validation. The flexible API that has made chessboard.js useful in a variety of applications is fully available, and if necessary chessboard.js can be used as a fallback for hessboard3.js in case WebGL is not available.

Since it uses WebGL and three.js to render the board (as opposed to DOM manipulation with JQuery), chessboard3.js is naturally going to be more resource-intensive. You can do the same things you can with Chris Oakman's chessboard.js (given the caveats that come with using WebGL).

Extra equipment you may need

Neither chessboard3.js nor chessboard.js actually knows how to play chess! You need separate components for the following:

  • PGN parsing
  • Move validation
  • A chess engine (you can use a Javascript chess engine like cinnamon)

Dependencies

The set of extra libraries used by chessboard3.js differs from those used by chessboard.js:

  • three.js : Tested against revision 80.
  • OrbitControls.js) : Optional, this is a three.js extension that allows the user to grab the board and either spin it around or zoom into it.

The font and piece geometry files from assets directory; these are accessed via JSON

I have code that uses chessboard.js for a 2D board. What code changes are needed for a 3D board?

You would replace this:

var board = new ChessBoard('divElementID', configObject);

with this:

var board = new ChessBoard3('divElementID', configObject);

You will also want to place it in a wider DIV, since a 3D board generally needs more real estate. While chessboard.js sets the widget height to be equal to the width to make a square widget, chessboard3.js sets the height to 75% of the width for a 4:3 aspect ratio.

API

An overview, documentation, and a playable demo can be found at http://chessboard3js.com.

Since chessboard3.js exposes a slight superset of the chessboard.js API, another good reference is http://chessboardjs.com/docs.

License

chessboard3.js is released under the MIT License.

beast-chessboard's People

Contributors

jtiscione avatar jason-rovitracker avatar mliebelt 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.