UNPKG
@needle-tools/three
Version:
latest (0.183.2-canary.0)
next (0.169.20-experimental.0)
0.183.2-canary.0
0.169.20
0.169.20-experimental.0
0.169.19
0.169.18
0.169.17
0.169.16
0.169.16-experimental.0
0.169.15
0.169.14
0.169.13
0.169.12
0.169.11
0.169.10
0.169.9
0.169.8
0.169.7
0.169.6
0.169.5
0.169.4
0.169.3
0.169.2
0.169.1
0.162.12
0.162.11
0.162.10
0.162.9
0.162.8
0.162.7
0.162.6
0.162.5
0.162.4
0.162.3
0.162.2
0.162.1
0.160.3
0.160.2
0.154.3
0.154.2
0.154.1
0.153.1
0.153.0
0.146.10
0.146.9
0.146.8
0.146.7
0.146.6
0.146.5
0.146.4
0.146.3
0.146.2
0.146.1
0.145.4
0.145.2
0.145.1
0.145.0
JavaScript 3D library
threejs.org
mrdoob/three.js
@needle-tools/three
/
src
/
nodes
/
utils
/
Packing.js
5 lines
(3 loc)
•
219 B
JavaScript
View Raw
1
2
3
4
5
import
{ nodeObject }
from
'../tsl/TSLBase.js'
;
export
const
directionToColor
= (
node
) =>
nodeObject
( node ).
mul
(
0.5
).
add
(
0.5
);
export
const
colorToDirection
= (
node
) =>
nodeObject
( node ).
mul
(
2.0
).
sub
(
1
);