Remove useless prefix
This commit is contained in:
parent
6c56a31726
commit
7c74469324
|
|
@ -93,15 +93,15 @@ fn main() -> io::Result<()> {
|
||||||
let yaw = PI / 4.0;
|
let yaw = PI / 4.0;
|
||||||
let pitch = PI / 6.0;
|
let pitch = PI / 6.0;
|
||||||
let roll = 0.0f32;
|
let roll = 0.0f32;
|
||||||
let m_roll = glm::mat3(
|
let m_roll = mat3(
|
||||||
roll.cos(), roll.sin(), 0.0,
|
roll.cos(), roll.sin(), 0.0,
|
||||||
-roll.sin(), roll.cos(), 0.0,
|
-roll.sin(), roll.cos(), 0.0,
|
||||||
0.0, 0.0, 1.0);
|
0.0, 0.0, 1.0);
|
||||||
let m_yaw = glm::mat3(
|
let m_yaw = mat3(
|
||||||
yaw.cos(), 0.0, yaw.sin(),
|
yaw.cos(), 0.0, yaw.sin(),
|
||||||
0.0, 1.0, 0.0,
|
0.0, 1.0, 0.0,
|
||||||
-yaw.sin(), 0.0, yaw.cos());
|
-yaw.sin(), 0.0, yaw.cos());
|
||||||
let m_pitch = glm::mat3(
|
let m_pitch = mat3(
|
||||||
1.0, 0.0, 0.0,
|
1.0, 0.0, 0.0,
|
||||||
0.0, pitch.cos(), -pitch.sin(),
|
0.0, pitch.cos(), -pitch.sin(),
|
||||||
0.0, pitch.sin(), pitch.cos());
|
0.0, pitch.sin(), pitch.cos());
|
||||||
|
|
@ -126,7 +126,7 @@ fn main() -> io::Result<()> {
|
||||||
let ray = m_camera * normalize(ray);
|
let ray = m_camera * normalize(ray);
|
||||||
|
|
||||||
for f in &mesh {
|
for f in &mesh {
|
||||||
let color = glm::clamp(to_ivec3(f.normal * 120.0 + 128.0), ivec3(0, 0, 0), ivec3(255, 255, 255));
|
let color = clamp(to_ivec3(f.normal * 120.0 + 128.0), ivec3(0, 0, 0), ivec3(255, 255, 255));
|
||||||
let ds = (0..3).map(|k| edge_dist(f.vertices[k], f.vertices[(k + 1) % 3], base, ray));
|
let ds = (0..3).map(|k| edge_dist(f.vertices[k], f.vertices[(k + 1) % 3], base, ray));
|
||||||
if ds.into_iter().all(|d| d > 0.0) {
|
if ds.into_iter().all(|d| d > 0.0) {
|
||||||
img.put_pixel(x, y, Color(color.x as u8, color.y as u8, color.z as u8));
|
img.put_pixel(x, y, Color(color.x as u8, color.y as u8, color.z as u8));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user