use nalgebra::{Point3, Vector3, Translation3};
use ncollide3d::procedural;
use kiss3d::{window::Window, light::Light};
use rand::prelude::*;
use rand::distributions::Normal;
fn main() {
let mut window = Window::new("Terr: noise");
window.set_light(Light::StickToCamera);
let distr = Normal::new(0., 0.2);
let mut rng = rand::thread_rng();
let mut quad = procedural::quad::<f32>(100., 100., 100, 100);
for p in &mut quad.coords {
p.z = p.x;
p.x = p.y;
p.y = distr.sample(&mut rng) as f32; }
quad.recompute_normals();
let mut quad = window.add_trimesh(quad, Vector3::from_element(1.0));
quad.enable_backface_culling(true);
quad.set_color(0.75, 0.65, 0.4);
let mut sphere = window.add_sphere(1.0);
sphere.set_local_translation(Translation3::new(0., 1., 0.));
sphere.set_color(0.6, 0.2, 0.8);
let mut camera = kiss3d::camera::ArcBall::new(Point3::new(0., 3., 15.), Point3::new(0., 0., 1.));
while window.render_with_camera(&mut camera) {
}
}