summaryrefslogtreecommitdiff
path: root/graphics.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-05-20 20:20:48 +0000
committerrodri <rgl@antares-labs.eu>2024-05-20 20:20:48 +0000
commitd3516b11559657935d70829c672f29393e857b8e (patch)
tree13c2b87f9daf6bd813f43c750fef52d5b8b34ddd /graphics.h
parent6e461add61d35d23f733cffb5064a286419b79b0 (diff)
downloadlibgraphics-d3516b11559657935d70829c672f29393e857b8e.tar.gz
libgraphics-d3516b11559657935d70829c672f29393e857b8e.tar.bz2
libgraphics-d3516b11559657935d70829c672f29393e857b8e.zip
fix the perspective projection and add inverse xform functions.
Diffstat (limited to 'graphics.h')
-rw-r--r--graphics.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/graphics.h b/graphics.h
index 760d8a5..1158bef 100644
--- a/graphics.h
+++ b/graphics.h
@@ -276,10 +276,19 @@ void rmviewport(Viewport*);
/* render */
Renderer *initgraphics(void);
+
+/* xform */
Point3 model2world(Entity*, Point3);
Point3 world2vcs(Camera*, Point3);
Point3 vcs2clip(Camera*, Point3);
Point3 world2clip(Camera*, Point3);
+Point3 clip2ndc(Point3);
+Point3 ndc2viewport(Framebuf*, Point3);
+Point3 viewport2ndc(Framebuf*, Point3);
+Point3 ndc2vcs(Camera*, Point3);
+Point3 viewport2vcs(Camera*, Point3);
+Point3 vcs2world(Camera*, Point3);
+Point3 viewport2world(Camera*, Point3);
void perspective(Matrix3, double, double, double, double);
void orthographic(Matrix3, double, double, double, double, double, double);