I make my own voxel engine and when I set texture on trinagle it looks weird and not correct here my triangle render code:
vertices[0].position.x = draw_face.point0.x;
vertices[0].position.y = draw_face.point0.y;
vertices[0].tex_coord = {float(draw_face.t_ind0.x), float(draw_face.t_ind0.y)};
vertices[0].color = {
(unsigned char)(255 - (int)(draw_face.point_shadow0)),
(unsigned char)(255 - (int)(draw_face.point_shadow0)),
(unsigned char)(255 - (int)(draw_face.point_shadow0)),
255
};
vertices[1].position.x = draw_face.point1.x;
vertices[1].position.y = draw_face.point1.y;
vertices[1].tex_coord = {float(draw_face.t_ind1.x), float(draw_face.t_ind1.y)};
vertices[1].color = {
(unsigned char)(255 - (int)(draw_face.point_shadow1)),
(unsigned char)(255 - (int)(draw_face.point_shadow1)),
(unsigned char)(255 - (int)(draw_face.point_shadow1)),
255
};
vertices[2].position.x = draw_face.point2.x;
vertices[2].position.y = draw_face.point2.y;
vertices[2].tex_coord = {float(draw_face.t_ind2.x), float(draw_face.t_ind2.y)};
vertices[2].color = {
(unsigned char)(255 - (int)(draw_face.point_shadow2)),
(unsigned char)(255 - (int)(draw_face.point_shadow2)),
(unsigned char)(255 - (int)(draw_face.point_shadow2)),
255
};
SDL_RenderGeometry(renderer, texture, vertices, 3, NULL, 4);
when camera angle is 0:

and this is the my problem when camera is rotated:
