Skip to content

Magic73/billiards

 
 

Repository files navigation

billiards

codecov CodeFactor Open in Gitpod visitors

Unsophisticated billiards spinning ball physics.

Demo

In browser WebGL demo. Inspect physics using diagrams

Reference

Papers on ball mechanics, cushions and max spin simulation 1 2 3

3D graphics uses three.js

Inline LaTeX editor

Key equations

surface velocity

equation

sliding motion

equation

equation

equation

rolling motion

equation

equation

where

equation ,equation

cushion bounce

Setup

nvm use v14.15.1
yarn install
yarn dev

Test

yarn test
yarn coverage
yarn serve

Maintain

yarn deps
yarn upgrade -L
yarn prettify

Two player

yarn websocket
yarn serve

add query parameter to url ?websocketserver=wss://host

Features

Backspin and sidespin well modeled. Presentation in 2d or 3d in any modern browser. Record and playback breaks. Two player mode with node websocket server.

Controls

Use mouse or keyboard:

Aim

Control Fine aim

Topspin and backspin

Shift Side spin

Space Hit - hold for more power

Progress snapshots

July 2018

July 2019

March 2021

About

billiards physics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.4%
  • JavaScript 2.6%