ft (wip): textures

This commit is contained in:
2026-05-12 18:20:06 +02:00
parent 383f739808
commit 6a1e50fb7a
13 changed files with 222 additions and 6 deletions

View File

@@ -29,6 +29,14 @@ impl Vec3 {
}
}
pub fn from_u8(r: u8, b: u8, g: u8) -> Self {
Self {
x: r as f32 / 255.,
y: g as f32 / 255.,
z: b as f32/ 255.,
}
}
pub fn random() -> Self {
let mut rng = rand::rng();
Self {
@@ -492,3 +500,4 @@ impl Display for Vec3 {
write!(f, "({}, {}, {})", self.x, self.y, self.z)
}
}