Skip to content

Sphere

Defined in: radiance/src/objects/Sphere.ts:10

The analytic sphere (design record 0001, “The analytic sphere”): a centre and a radius that the path tracer meets by the quadratic, with no triangle. The position is the centre. The rotation turns the texture, and nothing else. The scale must be uniform, or the render stops with a RangeError. The material must not emit, or the render stops with a TypeError.

new Sphere(radius, material): Sphere

Defined in: radiance/src/objects/Sphere.ts:12

number

The radius in the sphere’s own space, above 0 and finite. Times the world scale.

Material

Sphere

Object3D.constructor

readonly children: Object3D[] = []

Defined in: radiance/src/core/Object3D.ts:21

Object3D.children


readonly id: number

Defined in: radiance/src/core/Object3D.ts:13

Object3D.id


readonly isSphere: true = true

Defined in: radiance/src/objects/Sphere.ts:11


material: Material

Defined in: radiance/src/objects/Sphere.ts:15


readonly matrix: Matrix4

Defined in: radiance/src/core/Object3D.ts:18

Object3D.matrix


readonly matrixWorld: Matrix4

Defined in: radiance/src/core/Object3D.ts:19

Object3D.matrixWorld


name: string = ''

Defined in: radiance/src/core/Object3D.ts:14

Object3D.name


parent: Object3D | null = null

Defined in: radiance/src/core/Object3D.ts:20

Object3D.parent


readonly position: Vector3

Defined in: radiance/src/core/Object3D.ts:15

Object3D.position


radius: number

Defined in: radiance/src/objects/Sphere.ts:14

The radius in the sphere’s own space, above 0 and finite. Times the world scale.


readonly rotation: Euler

Defined in: radiance/src/core/Object3D.ts:16

Object3D.rotation


readonly scale: Vector3

Defined in: radiance/src/core/Object3D.ts:17

Object3D.scale


visible: boolean = true

Defined in: radiance/src/core/Object3D.ts:23

Hidden objects and their children are left out of the render.

Object3D.visible

add(…objects): this

Defined in: radiance/src/core/Object3D.ts:25

…Object3D[]

this

Object3D.add


lookAt(target): this

Defined in: radiance/src/core/Object3D.ts:71

Turn so that the object’s -z axis points at target (in its parent’s space), with no roll: how a camera is aimed. Straight up or down keeps the current yaw.

Vector3

this

Object3D.lookAt


remove(…objects): this

Defined in: radiance/src/core/Object3D.ts:35

…Object3D[]

this

Object3D.remove


traverse(fn): void

Defined in: radiance/src/core/Object3D.ts:47

Call fn on this object and every descendant, parents first.

(o) => void

void

Object3D.traverse


traverseVisible(fn): void

Defined in: radiance/src/core/Object3D.ts:53

Like traverse, but skipping hidden objects and what is under them.

(o) => void

void

Object3D.traverseVisible


updateMatrixWorld(): void

Defined in: radiance/src/core/Object3D.ts:60

Recompute matrix from position, rotation and scale, and matrixWorld down the tree.

void

Object3D.updateMatrixWorld