Skip to content
Jakob Mass edited this page Nov 22, 2015 · 16 revisions

Overall goal

  • Ability to play classic 8-ball pool in the same browser instance by taking turns
  • Ability to play a modified version of 8-ball pool with a possibility to sabotage the other player

Progress so far:

Try here, hosting your own requires a web server

Basic scene with shiny balls

  • The balls use a THREE.MeshPhongMaterial.

  • Two THREE.SpotLights are placed above the table, these make the balls and the table cast shadows.

  • The balls collide and bounce from walls

  • Decided on using Cannon.js to complement three.js

  • The camera can be controlled using the mouse.

  • The OrbitControl module is used for this

  • The camera controls update the white balls "forward vector" which is used to determine where to apply a force impulse as defined in Cannon.js

A 3D model of the tabletop

  • Initially constructed in Google Sketchup, then exported to Blender and then to three.js json format
  • Some edges are not round enough
  • The default scale doesn't match our convention of 1 unit = 1 cm, need change either the convention or the model
  • The table won't stay like that - it will eventually get legs to stand on
  • Instead of programmed walls, we should be using convex shapes, if that doesn't work then preprogrammed walls it is :(
  • Observed problem: Pool tables are loosely specified (even in World Pool-Billiard Association rules - a technical drawing of the perfect table would have been nice). People don't seem to care as long as it "feels" and "behaves" right. Since most of the rules are defined by Americans or the British, the units everywhere are in inches, for which Sketchup was convenient because both imperial/metric units can be used.

The road ahead (including, but not limited to)

  • Implement a gametype (turns. game state and rules)
  • Add a cue stick
  • Find a nice wood texture for the outer sides of the table
  • Create a GUI and load all assets before starting the game
  • Add/improve aiming (mouse movement is a bit too sensitive)
  • Improve lighting
  • Add environment mapping to make the balls reflective.
  • Try adding bumpmap for the table cloth surface
Clone this wiki locally