Shape matching rigid body system using HTML5 as rendering engine