Skip to content

Instantly share code, notes, and snippets.

View rogerscg's full-sized avatar

Greg Rogers rogerscg

  • Waymo
  • New York, NY
View GitHub Profile
@bhollis
bhollis / checkerboard.js.coffee
Created November 28, 2013 02:31
Three.js snippet for creating a checkerboard plane. Good for use as a floor in demos.
# Build a checkerboard colored square plane with "segments" number of tiles per side.
# Using three.js v62
checkerboard = (segments=8) ->
geometry = new THREE.PlaneGeometry(100, 100, segments, segments)
materialEven = new THREE.MeshBasicMaterial(color: 0xccccfc)
materialOdd = new THREE.MeshBasicMaterial(color: 0x444464)
materials = [materialEven, materialOdd]
for x in [0...segments]
for y in [0...segments]