Function generate_sphere

Source
pub fn generate_sphere(
    radius: f32,
    width_segments: usize,
    height_segments: usize,
) -> (Vec<Point3<f32>>, Vec<Triangle>, Vec<Vector3<f32>>, Vec<Vector2<f32>>)
Expand description

Generate a sphere with subdivisions

§Parameters

  • radius - Radius of the sphere
  • width_segments - Number of horizontal subdivisions
  • height_segments - Number of vertical subdivisions

§Returns

Tuple of (positions, indices, normals, uvs)