Sphere resolution depends on radius
@@ -7,7 +7,7 @@ pub struct Sphere {
impl Sphere {
pub fn new(context: &Context, center: Vec3, radius: f32) -> ThreeDResult<Self> {
- let mut mesh = CPUMesh::sphere(8);
+ let mut mesh = CPUMesh::sphere((radius * 20.0).max(4.0) as u32);
mesh.transform(&(Mat4::from_translation(center) * Mat4::from_scale(radius)));
let model = Model::new(context, &mesh)?;
Ok(Self { model })
