If swizzling is possible in JavaScript, what would be the best way or a good start to vector swizzling? It would be similar to swizzling in other programming languages, for instance, glsl:
vec3 v = vec3(fragCoord.xy, 0);
Something like this should be achieved in JavaScript:
var v1 = vec(1, 2, 3);
var v2 = v1.zyx;
If you want something like that then I made the library
Please try
https://github.com/KukuhGit/SwizzVec
How to use
Not yet supported
And mathematical operations in it
But if you agree, I will update the code or you can recommend an update and help later