Skip to content

SphereGeometry

Defined in: radiance/src/geometries/SphereGeometry.ts:12

A sphere about the origin, with three.js’s vertex order and uv layout (three.js’s SphereGeometry over the whole sphere). The poles are rows of widthSegments + 1 vertices that share one position. Its normals point outward. widthSegments is at least 3 and heightSegments at least 2, as in three.js, and both are rounded down.

The path tracer draws its triangles, shaded with the vertices’ normals, so more segments give a rounder outline.

new SphereGeometry(radius?, widthSegments?, heightSegments?): SphereGeometry

Defined in: radiance/src/geometries/SphereGeometry.ts:17

number = 1

number = 32

number = 16

SphereGeometry

BufferGeometry.constructor

readonly heightSegments: number

Defined in: radiance/src/geometries/SphereGeometry.ts:15


readonly radius: number = 1

Defined in: radiance/src/geometries/SphereGeometry.ts:18


readonly type: string = 'SphereGeometry'

Defined in: radiance/src/geometries/SphereGeometry.ts:13

BufferGeometry.type


version: number = 0

Defined in: radiance/src/geometries/BufferGeometry.ts:18

Incremented by the setter of every attribute, and by the author after an in-place edit.

BufferGeometry.version


readonly widthSegments: number

Defined in: radiance/src/geometries/SphereGeometry.ts:14

get index(): Uint32Array

Defined in: radiance/src/geometries/BufferGeometry.ts:56

Three vertex indices per triangle, counter-clockwise seen from the front. Required.

Uint32Array

set index(value): void

Defined in: radiance/src/geometries/BufferGeometry.ts:59

Uint32Array

void

BufferGeometry.index


get normal(): Float32Array | undefined

Defined in: radiance/src/geometries/BufferGeometry.ts:35

xyz per vertex, unit length. Computed by computeVertexNormals() when absent.

Float32Array | undefined

set normal(value): void

Defined in: radiance/src/geometries/BufferGeometry.ts:38

Float32Array | undefined

void

BufferGeometry.normal


get position(): Float32Array

Defined in: radiance/src/geometries/BufferGeometry.ts:26

xyz per vertex. Required.

Float32Array

set position(value): void

Defined in: radiance/src/geometries/BufferGeometry.ts:29

Float32Array

void

BufferGeometry.position


get uv(): Float32Array | undefined

Defined in: radiance/src/geometries/BufferGeometry.ts:47

uv per vertex, three.js’s layout: v = 1 at the top of a plane and at a sphere’s north pole (design record 0001, Amendment 1). Absent: every uv is 0.

Float32Array | undefined

set uv(value): void

Defined in: radiance/src/geometries/BufferGeometry.ts:50

Float32Array | undefined

void

BufferGeometry.uv

computeBoundingBox(): Box3

Defined in: radiance/src/geometries/BufferGeometry.ts:103

The box around position. A geometry with no vertex gives an empty box: min above max.

Box3

BufferGeometry.computeBoundingBox


computeVertexNormals(): this

Defined in: radiance/src/geometries/BufferGeometry.ts:68

Sets normal to the area-weighted mean of the normals of the triangles that share each vertex, as three.js does. A vertex that no triangle uses gets (0, 0, 0). Adds 1 to version.

this

BufferGeometry.computeVertexNormals