sphere/
sphere.rs

1//! Raymarched sphere with orbiting camera - demonstrates world-space effects.
2
3use hoplite::{AppConfig, OrbitCamera, OrbitMode, Vec3, run_with_config};
4
5fn main() {
6    run_with_config(AppConfig::new().title("Raymarched Sphere"), |ctx| {
7        ctx.hot_effect_world("examples/shaders/sphere.wgsl");
8
9        let mut orbit = OrbitCamera::new()
10            .target(Vec3::ZERO)
11            .distance(3.0)
12            .elevation(0.3)
13            .fov(90.0)
14            .mode(OrbitMode::AutoRotate { speed: 0.5 });
15
16        move |frame| {
17            orbit.update(frame.input, frame.dt);
18            frame.set_camera(orbit.camera());
19        }
20    });
21}