Source

LWJGL Shader Tutorials / src / main / java / com / ra4king / opengl / arcsynthesis / gl33 / chapter3 / example3 / example3.3.vert

Full commit
#version 330

layout(location = 0) in vec4 position;
uniform float loopDuration;
uniform float time;

void main()
{
	float timeScale = 3.14159 * 2.0 / loopDuration;
	
	float currTime = mod(time, loopDuration);
	
	gl_Position = position + vec4(cos(currTime * timeScale) * 0.5,
								  sin(currTime * timeScale) * 0.5,
								  0.0,
								  0.0);
}