mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
|
{
|
||
|
"name": "sdf3d_rotate",
|
||
|
"node_position": {
|
||
|
"x": 0,
|
||
|
"y": 0
|
||
|
},
|
||
|
"parameters": {
|
||
|
"a": 0,
|
||
|
"ax": 0,
|
||
|
"ay": 0,
|
||
|
"az": 0,
|
||
|
"x": 0.35,
|
||
|
"y": 0,
|
||
|
"z": 0
|
||
|
},
|
||
|
"shader_model": {
|
||
|
"code": "",
|
||
|
"global": "vec3 rotate3d(vec3 p, vec3 a) {\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n",
|
||
|
"inputs": [
|
||
|
{
|
||
|
"default": "0.0",
|
||
|
"label": "",
|
||
|
"name": "in",
|
||
|
"type": "sdf3d"
|
||
|
}
|
||
|
],
|
||
|
"instance": "",
|
||
|
"name": "Rotate",
|
||
|
"outputs": [
|
||
|
{
|
||
|
"sdf3d": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))",
|
||
|
"type": "sdf3d"
|
||
|
}
|
||
|
],
|
||
|
"parameters": [
|
||
|
{
|
||
|
"default": 0,
|
||
|
"label": "X",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "ax",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
},
|
||
|
{
|
||
|
"default": 0,
|
||
|
"label": "Y",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "ay",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
},
|
||
|
{
|
||
|
"default": 0,
|
||
|
"label": "Z",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "az",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"type": "shader"
|
||
|
}
|