Skip to content

Commit 9519a74

Browse files
committed
near and far flipped when creating projection matrix
1 parent abe0848 commit 9519a74

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/processing_render/src/graphics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ impl CameraProjection for ProcessingProjection {
102102
self.width,
103103
self.height, // bottom = height
104104
0.0, // top = 0
105-
self.far,
106105
self.near,
106+
self.far,
107107
)
108108
}
109109

@@ -720,7 +720,7 @@ mod tests {
720720
let clip_matrix = proj.get_clip_from_view();
721721
// Check some values in the matrix to ensure it's correct
722722
// In [0,1] depth orthographic projection, w_axis.z = -near/(far-near)
723-
let expected = -0.1 / (1000.0 - 0.1);
723+
let expected: f32 = -0.1 / (1000.0 - 0.1);
724724
assert!((clip_matrix.w_axis.z - expected).abs() < 1e-6);
725725
}
726726

0 commit comments

Comments
 (0)