#version 460 core
layout (location = 0) in vec3 aPos;						// Define input variables that are read from vertex Attribute Pointer					// this input variable is a rgb color vector
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTexCoord;
out vec3 Normal;
out vec3 FragPos;
out vec2 TexCoordOI;

// Matrices for 3D Coordinates Systems
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 normalMatrix; // Corrects direction of normal after nonuniform stretching 



void main(){
	gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(aPos.x, aPos.y, aPos.z, 1.0f);	// always write result of the calculations to gl_Position to have it rendered (mandatory) 
	vec4 Normal4d = normalMatrix * vec4(aNormal,0);
	Normal = vec3(Normal4d.x, Normal4d.y, Normal4d.z);
	FragPos = vec3(modelMatrix *vec4(aPos,1));
	TexCoordOI = aTexCoord;
};