Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _FIREFLY3D
- #define _FIREFLY3D
- #include "fixed.h"
- #include "MonochromeLib.h"
- /** DEFINES **/
- #define FIREFLY3D_SCREEN_WIDTH 128
- #define FIREFLY3D_SCREEN_HEIGHT 64
- /** STUCTRURES **/
- typedef struct
- {
- int x, y, z;
- char color;
- } Point_3D;
- typedef struct
- {
- Point_3D* points[2];
- char color;
- } Line_3D;
- typedef struct
- {
- Line_3D* lines[3];
- char color;
- } Face_3D;
- typedef struct
- {
- int nbFaces;
- Face_3D** faces;
- } Object_3D;
- typedef struct
- {
- int x, y, z;
- } Translation_vector;
- typedef struct
- {
- fix x, y, z;
- } Rotation_vector;
- typedef struct
- {
- int focal_length;
- Point_3D position;
- Rotation_vector orientation;
- } Camera_3D;
- /** FUNCTIONS **/
- void FF_translate_point(Point_3D* point, Translation_vector translation);
- void FF_rotation_point(Point_3D* point, Point_3D rotation_center, Rotation_vector rotation);
- void FF_place_point_3D(Point_3D* point, int x, int y, int z, int color);
- Point_3D* FF_new_point_3D(int x, int y, int z, int color);
- void FF_alloc_line_3D(Line_3D* line, Point_3D* point_0, Point_3D* point_1, int color);
- void FF_alloc_face_3D(Face_3D* face, Line_3D* line_0, Line_3D* line_1, Line_3D* line_2, int color);
- void FF_draw_point_fixed_camera(Point_3D point, int focale);
- void FF_draw_line_fixed_camera(Line_3D line, int focale);
- void FF_draw_face_fixed_camera(Face_3D face, int focale);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement