{
const scene = new ln.Scene()
const simplex = new SimplexNoise(Date.now())
for (let x = -60; x <= 20; x += 2) {
for (let y = -30; y <= 30; y += 2) {
const p = .8
const cube = new ln.Cube(
new ln.Vector(x - p, y - p, -5),
new ln.Vector(x + p, y + p, 2 + simplex.noise2D(x / 25, y / 25) * 3)
)
cube.paths = function() {
const paths = []
const { x: x1, y: y1, z: z1 } = this.min
const { x: x2, y: y2, z: z2 } = this.max
for(let i = 0; i <= 5; i++) {
const p = i / 5
const x = x1 + (x2 - x1) * p
const y = y1 + (y2 - y1) * p
paths.push([new ln.Vector(x, y1, z1), new ln.Vector(x, y1, z2)])
paths.push([new ln.Vector(x, y2, z1), new ln.Vector(x, y2, z2)])
paths.push([new ln.Vector(x1, y, z1), new ln.Vector(x1, y, z2)])
paths.push([new ln.Vector(x2, y, z1), new ln.Vector(x2, y, z2)])
}
return paths
}
scene.add(cube)
}
}
const eye = new ln.Vector(8, 0, 6)
const center = new ln.Vector(4.8, 0, 0)
const up = new ln.Vector(0, 1, 0)
const paths = scene.render(eye, center, up, w, h, 100, 0.1, 100, 0.01)
return svg`${ln.toSVG(paths, w, h)}`
}