πŸ”ΉAdd Light to the Scene

addLighttoScene: to add Light to the scene (returns id of light)

type

type of light

required

β€˜ambient’ | β€˜directional’ | β€˜spot’ | β€˜point’

position

default: [0, 0, 0] (for directional, spot and point)

optional

[float, float, float]

angle

default:PI/3(for spot)

optional

Number: [0, PI/2]

color

Default: 0xffffff

optional

string

decay

Default: 2 (for spot and point)

optional

number

distance

Default: 0(for spot and point)

optional

number

intensity

Default: 1

optional

float

penumbra

Default: 0(for spot)

optional

Number: [0, 1]

// var light1 = IDE.addLighttoScene({
    color: "0xff31d1" || "red",
    type: "ambient",
    intensity: 1,
})

removeLightfromScene:

// IDE.removeLightfromScene({ id: light1 })

id

id of light

required

string

Last updated