shithub: tinyrend

Download patch

ref: 873c10820c62e5f2d206131a8d6f52195a596aa8
parent: 1b76dd0177af7e6949f8c20c434844f8d559b6cd
author: rodri <rgl@antares-labs.eu>
date: Sat Nov 18 13:12:22 EST 2023

put all the transformations in a single matrix.

--- a/main.c
+++ b/main.c
@@ -477,10 +477,6 @@
 		t.p1 = Pt3(verts[idxtab->indices[1]].x,verts[idxtab->indices[1]].y,verts[idxtab->indices[1]].z,verts[idxtab->indices[1]].w);
 		t.p2 = Pt3(verts[idxtab->indices[2]].x,verts[idxtab->indices[2]].y,verts[idxtab->indices[2]].z,verts[idxtab->indices[2]].w);
 
-		t.p0 = xform3(t.p0, rota);
-		t.p1 = xform3(t.p1, rota);
-		t.p2 = xform3(t.p2, rota);
-
 		st.p0 = xform3(t.p0, view);
 		st.p1 = xform3(t.p1, view);
 		st.p2 = xform3(t.p2, view);
@@ -935,6 +931,7 @@
 	};
 	identity3(rota);
 	mulm3(rota, yrot);
+	mulm3(proj, rota);
 	mulm3(view, proj);
 	rendering = 1;
 	proccreate(renderer, nil, mainstacksize);