I’ve the next parallel projection (Row main):
And it’s giving me the next output:
When in actuality it must be giving me this (picture not centered):
n is 0.1
and f is 100
The origin is in the midst of the wireframe and the 42 wireframe top is within the +z route.
My matrix multiplication:
typedef struct s_point
{
float x;
float y;
float z;
int c; //coloration
} t_point;
void multiply_matrix_vector(t_point *i, t_point *o, t_pmatrix *m)
{
float w;
o->x = i->x * m->m[0][0] + i->y * m->m[1][0] + i->z * m->m[2][0] + m->m[3][0];
o->y = i->x * m->m[0][1] + i->y * m->m[1][1] + i->z * m->m[2][1] + m->m[3][1];
o->z = i->x * m->m[0][2] + i->y * m->m[1][2] + i->z * m->m[2][2] + m->m[3][2];
w = i->x * m->m[0][3] + i->y * m->m[1][3] + i->z * m->m[2][3] + m->m[3][3];
if (w != 0.0f)
{
o->x /= w;
o->y /= w;
o->z /= w;
}
o->c = i->c;
}
What am I doing mistaken?