sampling in random hemisphere
This commit is contained in:
@@ -14,8 +14,8 @@ impl Camera {
|
||||
|
||||
pub fn new(aspect: f32, fov: f32) -> Self {
|
||||
Self {
|
||||
position: (2.0, 1.0, -1.0).into(),
|
||||
forward: (-0.66, -0.33, 0.66).into(),
|
||||
position: (1.0, 2.0, 1.0).into(),
|
||||
forward: (0.66, -0.25, 0.66).into(),
|
||||
up: Vector3::unit_y(),
|
||||
aspect,
|
||||
fovy: fov,
|
||||
@@ -33,6 +33,6 @@ impl Camera {
|
||||
}
|
||||
|
||||
pub fn view_matrix(&self) -> Matrix4<f32> {
|
||||
return Matrix4::look_to_rh((0.0,0.0,0.0).into(), self.forward, self.up);
|
||||
return Matrix4::look_to_rh((0.0,0.0,0.0).into(), self.forward.normalize(), self.up);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user