Skip to content

Instantly share code, notes, and snippets.

@neiltron
Created January 19, 2018 15:49
Show Gist options
  • Save neiltron/26a96d34a2d425a557ae9ac9319be438 to your computer and use it in GitHub Desktop.
Save neiltron/26a96d34a2d425a557ae9ac9319be438 to your computer and use it in GitHub Desktop.
Create basic, straight line meshes for webgl
const line = Array(40).fill([0, 0, 0]).map((el, index) => [.01 * (index % 2 ? 1 : -1), .2 * Math.floor(index / 2.0), 0]);
const cells = [];
for (let i = 0; i < 20; i += 2) {
cells.push(0 + i, 1 + i, 2 + i);
cells.push(1 + i, 2 + i, 3 + i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment