RujiK
Member
So I'm rendering a very basic 3d model that has it's vertices placed one by one. This works but the model seems to completely (kinda) ignore 3d depth. Image below:
(Top lizard is what I have and the bottom is what I want.)
I'm not really sure how to fix this as depth is being handled by internally by GMS as far as I am aware.
Matrix code which may or may not be relevant:
I'd appreciate any help. Thanks guys!
(Top lizard is what I have and the bottom is what I want.)
I'm not really sure how to fix this as depth is being handled by internally by GMS as far as I am aware.
Matrix code which may or may not be relevant:
GML:
var _cy = dcos(cam_pitch),
_sy = dsin(cam_pitch),
_cz = dcos(cam_yaw),
_sz = dsin(cam_yaw),
_cx = dcos(cam_roll),
_sx = dsin(cam_roll);
cam_view[0] = _cz*_sy*_sx+_sz*_cx; cam_view[4] = -_sz*_sy*_sx+_cz*_cx; cam_view[8] = -_cy*_sx; //x
cam_view[1] = -_cz*_sy*_cx+_sz*_sx; cam_view[5] = _sz*_sy*_cx+_cz*_sx; cam_view[9] = _cy*_cx; //y
cam_view[2] = _cz*_cy; cam_view[6] = -_sz*_cy; cam_view[10] = _sy; //z
cam_view[12] = round(-cam_x * cam_view[0] - cam_y * cam_view[4] - cam_z * cam_view[8]); //FLOOR causes jittering some shaders. (gl_position inconsistencies I guess)
cam_view[13] = round(-cam_x * cam_view[1] - cam_y * cam_view[5] - cam_z * cam_view[9]);
cam_view[14] = round(-cam_x * cam_view[2] - cam_y * cam_view[6] - cam_z * cam_view[10]);
cam_view[15] = 1;
matrix_set( matrix_view, cam_view );