example S1: event cancellation

The lines that start with angled brackets (less-than symbols) form a minimal HTML document. The HTML lines, except for the script tags, are reproduced below. Not much is going on beyond the creation of a canvas that we will render to later.

This line includes the three.js library.

The next script tag starts a large block of code that is the actual example. The code consists largely of a single function definition.

function init()

example S1