#version 330 core
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 WorldMatrix;
uniform mat4 TextureMatrix; // transform from object to pincushion space

in vec3 POSITION;
out vec3 coord;

void main()
{
	vec4 p2 = WorldMatrix * vec4(POSITION, 1.0);
	//coord = (TextureMatrix * vec4(POSITION, 1.0)).z;
	coord = vec3(TextureMatrix * p2);
	gl_Position = ModelViewProjectionMatrix * vec4(POSITION, 1.0);
}
