-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
transform.cljs
65 lines (53 loc) · 2.64 KB
/
transform.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
(ns mathbox.primitives.transform
(:require ["mathbox-react" :as box]
[reagent.core :as r]))
(def Fragment
"*Apply custom fragment shader pass*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:gamma`: `false` (boolean) - Pass RGBA values in sRGB instead of linear RGB
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:pass`: `\"light\"` (fragmentPass) - Fragment pass (color, light, rgba)
- `:shader`: `\"<\"` (select) - Shader to use"
(r/adapt-react-class box/Fragment))
(def Layer
"*Independent 2D layer/overlay*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:depth`: `1` (number) - 3D Depth
- `:fit`: `y` (fit) - Fit to (contain, cover, x, y)
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:pass`: `\"view\"` (vertexPass) - Vertex pass (data, view, world, eye)"
(r/adapt-react-class box/Layer))
(def Mask
"*Apply custom mask pass*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:shader`: `\"<\"` (select) - Shader to use"
(r/adapt-react-class box/Mask))
(def Transform
"*Transform geometry in 3D*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:eulerOrder`: `xyz` (swizzle) - 3D Euler order
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:matrix`: `[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]` (mat4) - 3D Projective Matrix
- `:pass`: `\"view\"` (vertexPass) - Vertex pass (data, view, world, eye)
- `:position`: `[0, 0, 0]` (vec3) - 3D Position
- `:quaternion`: `[0, 0, 0, 1]` (quat) - 3D Quaternion
- `:rotation`: `[0, 0, 0]` (vec3) - 3D Euler rotation
- `:scale`: `[1, 1, 1]` (vec3) - 3D Scale"
(r/adapt-react-class box/Transform))
(def Transform4
"*Transform geometry in 4D*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:matrix`: `[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]` (mat4) - 4D Affine Matrix
- `:pass`: `\"view\"` (vertexPass) - Vertex pass (data, view, world, eye)
- `:position`: `[0, 0, 0, 0]` (vec4) - 4D Position
- `:scale`: `[1, 1, 1, 1]` (vec4) - 4D Scale"
(r/adapt-react-class box/Transform4))
(def Vertex
"*Apply custom vertex shader pass*
- `:classes`: `[]` (string array) - Custom classes, e.g. `[\"big\"]`
- `:id`: `null` (nullable string) - Unique ID, e.g. `\"sampler\"`
- `:pass`: `\"view\"` (vertexPass) - Vertex pass (data, view, world, eye)
- `:shader`: `\"<\"` (select) - Shader to use"
(r/adapt-react-class box/Vertex))