diff options
| author | rodri <rgl@antares-labs.eu> | 2020-04-17 11:37:10 +0000 |
|---|---|---|
| committer | rodri <rgl@antares-labs.eu> | 2020-04-17 11:37:10 +0000 |
| commit | e77a34629060abfad8e463efda0c3ffc54379793 (patch) | |
| tree | 9151e47fab853248f95594e6ef48999a1ff6255f /graphics.h | |
| parent | 263444216730830b712a4f8f3a087513c5ac93e9 (diff) | |
| download | 3dee-e77a34629060abfad8e463efda0c3ffc54379793.tar.gz 3dee-e77a34629060abfad8e463efda0c3ffc54379793.tar.bz2 3dee-e77a34629060abfad8e463efda0c3ffc54379793.zip | |
roll everything back.
Diffstat (limited to 'graphics.h')
| -rw-r--r-- | graphics.h | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/graphics.h b/graphics.h deleted file mode 100644 index 51c0a93..0000000 --- a/graphics.h +++ /dev/null @@ -1,51 +0,0 @@ -typedef enum { - Portho, /* orthographic */ - Ppersp /* perspective */ -} Projection; - -typedef struct Vertex Vertex; -typedef struct Viewport Viewport; -typedef struct Camera Camera; - -struct Vertex { - Point3 p; /* position */ - Point3 n; /* surface normal */ -}; - -struct Viewport -{ - RFrame; - Memimage *fb; -}; - -struct Camera { - RFrame3; /* VCS */ - Viewport viewport; - double fov; /* vertical FOV */ - double clipn; - double clipf; - Matrix3 proj; /* VCS to NDC xform */ - Projection ptype; - - void (*updatefb)(Camera*, Rectangle, ulong); -}; - -/* Camera */ -Camera *alloccamera(Rectangle, ulong); -void configcamera(Camera*, Image*, double, double, double, Projection); -void placecamera(Camera*, Point3, Point3, Point3); -void aimcamera(Camera*, Point3); -void reloadcamera(Camera*); - -/* rendering */ -#define FPS2MS(n) (1000/(n)) -#define WORLD2VCS(cp, p) (rframexform3((p), *(cp))) -#define VCS2NDC(cp, p) (xform3((p), (cp)->proj)) -#define WORLD2NDC(cp, p) (VCS2NDC((cp), WORLD2VCS((cp), (p)))) -int isclipping(Point3); -Point toviewport(Camera*, Point3); -Point2 fromviewport(Camera*, Point); -void perspective(Matrix3, double, double, double, double); -void orthographic(Matrix3, double, double, double, double, double, double); -void line3(Camera*, Point3, Point3, int, int, Image*); -Point string3(Camera*, Point3, Image*, Font*, char*); |
