Restore the view point
This commit is contained in:
parent
97cdbcff75
commit
abf5702fdd
|
|
@ -11,9 +11,10 @@ use winit::{
|
|||
fn make_viewport(w: u32, h: u32) -> [Vertex; 4] {
|
||||
let w = w as f32;
|
||||
let h = h as f32;
|
||||
let d = 3.;
|
||||
let (w, h) = (1.0f32.max(w / h), 1.0f32.max(h / w));
|
||||
let screen_coord = [vec2(-1., -1.), vec2(1., -1.), vec2(-1., 1.), vec2(1., 1.)];
|
||||
let world_coord = [vec3(-w, -h, 2.), vec3(w, -h, 2.), vec3(-w, h, 2.), vec3(w, h, 2.)];
|
||||
let world_coord = [vec3(-w, -h, d), vec3(w, -h, d), vec3(-w, h, d), vec3(w, h, d)];
|
||||
[0, 1, 2, 3].map(|k| Vertex {
|
||||
dir: world_coord[k],
|
||||
screen: screen_coord[k],
|
||||
|
|
@ -35,8 +36,8 @@ fn main() {
|
|||
noiser.set_params(
|
||||
&queue,
|
||||
perlin::Params {
|
||||
origin: vec3(0., 0., -12.),
|
||||
radius: 12.,
|
||||
origin: vec3(0., 0., -30.),
|
||||
radius: 30.,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user