ft (wip): textures
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user