I'm using a Model Matrix alone to transport the model I loaded (a monkey face from Blender) into a vbo from model space to world space. However, the model is incredibly distorted (Stretching to infinity), and I'm baffled as to why this is happening.
This video shows the model rotating constantly around the y-axis as an attempt to display my issue clearly. I am certain that the OBJ model I loaded is valid. A lava texture was bound to the model to make it easier to see.
The video also shows the console displaying the current matrix that I'm sending to my vertex shader. In memory, the matrix is expressed in row-major order, so the following matrix:
|1 0 0 0 |
|0 1 0 0 |
|0 0 1 10|
|0 0 0 1 |
is sent to my vertex shader as the following array of C++ floats:
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 10, 0, 0, 0, 1}
I believe that I am making a novice error in my mathematics. Is there any obvious error that can be noticed just from seeing the model alone? In my vertex shader (GLSL), I use the following line of code:
gl_Position = mvp * vec4(position, 1.0);
Where 'mvp' is the resultant matrix seen in the video and position contains the position of the current vertex of the model being processed (In model space). I don't understand why these distortions are occurring, could it be an error in another aspect of my program (i.e I'm not showing enough code)?
trasposeflag when sending your row-wise matrix?