Hi everybody!
trying to work with some circular shapes just wondering does somebody knows any kind of polar coordinates plugin or method to achieve that in resolume? thanks for your time!
kind regards,
B.
Thanks for your quick reply Joris!Joris wrote:It just so happens we have a polar coordinates plugin lined up for the 5.0.2 release.
Drop us a mail at resolume.com if you want early access.
Code: Select all
uniform sampler2D texture;
uniform vec2 resolution;
uniform float rings;
uniform float kaleidos;
uniform float aspect;
uniform float angle;
void main()
{
vec2 coords = gl_FragCoord.xy / resolution - vec2(0.5);
//adjust for aspect ratio
coords.y /= aspect;
//cartesion to polar with rings and kaleido vars
float r = length (coords) * (rings + 1.0);
float theta = atan( coords.y, coords.x ) * kaleidos;
//adjust center point of angle
//get fracts so we get useable values
float pi = 3.141592654;
theta = ( theta + ( angle + 0.25 ) * 2.0 * pi * kaleidos ) / ( 2.0 * pi );
vec2 endCoords = fract ( vec2( theta, r ));
gl_FragColor = gl_Color * texture2D( texture, endCoords );
}