use immense::*; use itertools::iproduct; use noise::{Fbm, NoiseFn}; use rand::*; use std::fs::File; const GRID: usize = 100; fn main() { let fbm = Fbm::new(); let rule = iproduct!((0..GRID), (0..GRID)).fold(Rule::new(), |rule, (i, j)| { let (u, v) = (i as f64 / GRID as f64, j as f64 / GRID as f64); rule.push( tf![ Tf::t(i as f32, 0.0, j as f32), Tf::sby(1.0, 1.0 + (fbm.get([u, v]) as f32).abs() * 80.0, 1.0) ], cube(), ) }); let mut output = File::create("noiseland.obj").expect("obj file"); write_meshes( ExportConfig { grouping: MeshGrouping::Individual, ..ExportConfig::default() }, rule.generate(), &mut output, ) .expect("rendered scene"); }