<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMesh/newEllipsoid(withRadii:radialSegments:verticalSegments:geometryType:inwardNormals:hemisphere:allocator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Model I/O",
      "ModelIO"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMesh(cm)newEllipsoidWithRadii:radialSegments:verticalSegments:geometryType:inwardNormals:hemisphere:allocator:"
  },
  "title" : "newEllipsoid(withRadii:radialSegments:verticalSegments:geometryType:inwardNormals:hemisphere:allocator:)"
}
-->

# newEllipsoid(withRadii:radialSegments:verticalSegments:geometryType:inwardNormals:hemisphere:allocator:)

Creates a mesh in the shape of an ellipsoid or sphere.

```
class func newEllipsoid(withRadii radii: vector_float3, radialSegments: Int, verticalSegments: Int, geometryType: MDLGeometryType, inwardNormals: Bool, hemisphere: Bool, allocator: (any MDLMeshBufferAllocator)?) -> Self
```

## Parameters

`radii`

A vector containing the width (x-component), height (y-component), and depth (z-component) of the bounding box of the ellipsoid to generate. If all components are equal, this method generates a sphere.

`radialSegments`

The number of points to generate around the horizontal circumference of the ellipsoid (that is, its cross-section in the xz-plane). A larger number of points increases rendering fidelity but decreases rendering performance.

`verticalSegments`

The number of points to generate along the height of the ellipsoid. A larger number of points increases rendering fidelity but decreases rendering performance.

`geometryType`

The type of geometric primitive — triangles or quads — from which to construct the mesh.

`inwardNormals`

<doc://com.apple.documentation/documentation/Swift/true> to generate normal vectors pointing toward the center of the ellipsoid; <doc://com.apple.documentation/documentation/Swift/false> to generate normal vectors pointing outward.

`hemisphere`

<doc://com.apple.documentation/documentation/Swift/true> to generate only the upper half of the ellipsoid or sphere (a dome); <doc://com.apple.documentation/documentation/Swift/false> to generate a complete ellipsoid or sphere.

`allocator`

An object responsible for allocating mesh vertex data. If `nil`, Model I/O  uses an internal allocator object.

## Return Value

A new mesh object.

## Discussion

This method generates vertex data for an ellipsoid centered at the origin of its local coordinate system.

The `inwardNormals` parameter determines the direction of generated vertex normal vectors for the mesh. Specify <doc://com.apple.documentation/documentation/Swift/true> if the mesh will be viewed from inside (for example, for use in a sky effect), or <doc://com.apple.documentation/documentation/Swift/false> if the mesh will be viewed from outside.

The `allocator` parameter controls vertex data allocation for the mesh. For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering using Metal, pass a <doc://com.apple.documentation/documentation/MetalKit/MTKMeshBufferAllocator> object. By specifying an allocator, you can ensure that mesh data is copied a minimal number of times between being read from a file and being loaded into GPU memory for rendering.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)