#version 130

uniform vec3 rotX;
uniform vec3 rotY;
uniform vec3 modelPosition;

in vec3 vPosition;

out vec3 fWorldPos;

void main()
{	
	vec3 rotZ = cross(rotX, rotY);
	
	vec3 rotatedPosition = vPosition.x * rotX + vPosition.y * rotY + vPosition.z * rotZ;
	vec3 translatedPosition = rotatedPosition + modelPosition;
		
	fWorldPos = translatedPosition;
	gl_Position = gl_ModelViewProjectionMatrix * vec4(fWorldPos, 1);
}