Skip to main content

Function: texturedSphere()

texturedSphere(options): TexturedSurface

Defined in: mobjects/three-d/TexturedSurface.ts:567

Create a textured sphere -- a common use case for Earth, Moon, etc.

This builds a ParametricSurface sphere internally and wraps it with a TexturedSurface, returning the ready-to-use mobject.

Parameters

options

TexturedSphereOptions

Returns

TexturedSurface

Example

const earth = texturedSphere({
textureUrl: '/textures/earth_day.jpg',
darkTextureUrl: '/textures/earth_night.jpg',
radius: 2,
lightDirection: [1, 0.5, 0],
});
scene.add(earth);