Compare commits

..

No commits in common. "5ebca540385976a07f2cab6dcbebce07798420ab" and "b842806d0b0db9bb6cd1ffee96d960adfad5ae22" have entirely different histories.

3 changed files with 5 additions and 11 deletions

BIN
bin/back

Binary file not shown.

View File

@ -78,12 +78,8 @@ int main(int argc, char** argv) {
p3.x = 12.0 ; p3.y = 8.0 ; p3.z = 1.0 ;
p4.x = 0.0 ; p4.y = 8.0 ; p4.z = 1.0 ;
for(int i = 0; i < 359; i++) {
resetBuffer();
project_rectangle(p1, p2, p3, p4);
bufferUpdateRenderer(rend);
three_angle = i+1 ;
}
printf("pass\n");
usleep(3000000);

View File

@ -197,11 +197,9 @@ void drawPolygonToBuffer(int count, ...) {
printf("(%d -> %d)\n", pmin, pmax);*/
for(int i = 0; i < poly_length; i++) {
if(polygon_b[i].x >= draw_const || polygon_b[(i+1)%pt_count].x >= draw_const) {
drawLineWithThiccToBuffer(4, polygon_b[i].x, polygon_b[(i+1)%poly_length].x, (int)polygon_b[i].y, (int)polygon_b[(i+1)%poly_length].y, (int)polygon_b[i].z, (int)polygon_b[(i+1)%poly_length].z, 255, 255, 255);
}
}
}
}
pt_3d adjust(pt_3d p) {
@ -210,8 +208,8 @@ pt_3d adjust(pt_3d p) {
res.y = p.y - (player_cy * 8 + player_y + εy) ;
res.z = p.z - 1.8 ; // height of player
res.x = res.x * cosinuses[three_angle] - (p.y - (player_cy * 8 + player_y + εy)) * sinuses[three_angle] ;
res.y = res.y * cosinuses[three_angle] + (p.x - (player_cx * 8 + player_x + εx)) * sinuses[three_angle] ;
res.x = res.y * sinuses[three_angle] + res.x * cosinuses[three_angle];
res.y = (p.y - (player_cy * 8 + player_y + εy)) * cosinuses[three_angle] + res.x * sinuses[three_angle] ;
return res;
}