Im trying to create a mesh of z = y^2 - x^2 for a uni assessment. Ive create a matrix array to that hold the sqaures that i want to draw as GL_LINE_STRIPS called sqaureMatrix[100]. What i want to know is how i can send that to a vertex shader and display it.
i will put some code below that says how ive set things up so far
asessment.cpp
mat4 squareMatrix[100];
// this is in general how i fill the matrix
mat4 pseudo = mat4
(
vec4(1,1,1,1),
vec4(1,1,1,1),
vec4(1,1,1,1),
vec4(1,1,1,1)
);
// loop through and actually add to the squarematrix like
squareMatrix[0] = pseudo;
vshader.glsl
uniform mat4 mMatrix;
void
main()
{
for (int i = 0; i < 100; i++)
{
gl_Position = mMatrix[i];
}
}
Well you get the jist of it. The matrix is set up fine. I thought I would just add it to clarify some things.
mat4s uses 1600. I'm not exactly sure what you are trying to do here, but that certainly cannot be it.