Improvements to terrain example
@@ -20,32 +20,29 @@ pub async fn run() {
let mut camera = Camera::new_perspective(
window.viewport(),
- vec3(-3.0, 1.0, 2.5),
- vec3(0.0, 0.0, 0.0),
+ vec3(-3.0, 3.0, 2.5),
+ vec3(0.0, 3.0, 0.0),
vec3(0.0, 1.0, 0.0),
degrees(45.0),
0.1,
1000.0,
);
- let mut control = OrbitControl::new(*camera.target(), 1.0, 100.0);
+ let mut control = FirstPersonControl::new(0.1);
// Source: https://polyhaven.com/
let mut loaded = if let Ok(loaded) =
- three_d_asset::io::load_async(&["../assets/chinese_garden_4k.hdr"]).await
+ three_d_asset::io::load_async(&["../assets/syferfontein_18d_clear_4k.hdr"]).await
{
loaded
} else {
three_d_asset::io::load_async(&[
- "https://asny.github.io/three-d/assets/chinese_garden_4k.hdr",
+ "https://asny.github.io/three-d/assets/syferfontein_18d_clear_4k.hdr",
])
.await
.expect("failed to download the necessary assets, to enable running this example offline, place the relevant assets in a folder called 'assets' next to the three-d source")
};
- let skybox = Skybox::new_from_equirectangular(
- &context,
- &loaded.deserialize("chinese_garden_4k").unwrap(),
- );
+ let skybox = Skybox::new_from_equirectangular(&context, &loaded.deserialize("hdr").unwrap());
let light = AmbientLight::new_with_environment(&context, 1.0, Color::WHITE, skybox.texture());
let noise_generator = SuperSimplex::new();
