This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |