mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-27 23:17:14 +01:00
69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
|
{
|
||
|
"name": "tex3d_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 tex3d_rotate(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": "vec3(1.0)",
|
||
|
"label": "",
|
||
|
"name": "in",
|
||
|
"type": "tex3d"
|
||
|
}
|
||
|
],
|
||
|
"instance": "",
|
||
|
"name": "TEX3D Rotate",
|
||
|
"outputs": [
|
||
|
{
|
||
|
"tex3d": "$in(vec4(tex3d_rotate($uv.xyz, -vec3($ax, $ay, $az)*0.01745329251), $uv.w))",
|
||
|
"type": "tex3d"
|
||
|
}
|
||
|
],
|
||
|
"parameters": [
|
||
|
{
|
||
|
"control": "None",
|
||
|
"default": 0,
|
||
|
"label": "X",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "ax",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
},
|
||
|
{
|
||
|
"control": "None",
|
||
|
"default": 0,
|
||
|
"label": "Y",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "ay",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
},
|
||
|
{
|
||
|
"control": "None",
|
||
|
"default": 0,
|
||
|
"label": "Z",
|
||
|
"max": 180,
|
||
|
"min": -180,
|
||
|
"name": "az",
|
||
|
"step": 1,
|
||
|
"type": "float"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"type": "shader"
|
||
|
}
|