つぶやきGLSL理解したい2
https://gyazo.com/d51a385cbd95bb9fa82ae8f1fd3b60b9
rotate3D
code::
mat3 rotate3D(float angle, vec3 axis){
vec3 a = normalize(axis);
float s = sin(angle);
float c = cos(angle);
float r = 1.0 - c;
return mat3(
a.x * a.x * r + c,
a.y * a.x * r + a.z * s,
a.z * a.x * r - a.y * s,
a.x * a.y * r - a.z * s,
a.y * a.y * r + c,
a.z * a.y * r + a.x * s,
a.x * a.z * r + a.y * s,
a.y * a.z * r - a.x * s,
a.z * a.z * r + c
);
}
code::
out vec4 o;
code::
ERROR: 0:31: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
ERROR: 0:31: 'out' : Local variables can only use the const storage qualifier.
ERROR: 0:31: 'out' : invalid qualifier combination
code::
for(o++;i++<1e2;g+=max(.05,e*.3)){
code::
ERROR: 0:38: 'for' : Invalid init declaration
In a for loop, the variable must be declared in the loop header itself, not outside:
うーん、環境が違うのかな。保留。
こちらは動く環境へのリンク付き