SHOW:
|
|
- or go back to the newest paste.
1 | #ifndef _FIREFLY3D | |
2 | #define _FIREFLY3D | |
3 | ||
4 | #include "fixed.h" | |
5 | - | #include "includes.h" |
5 | + | #include "MonochromeLib.h" |
6 | ||
7 | /** DEFINES **/ | |
8 | ||
9 | #define FIREFLY3D_SCREEN_WIDTH 128 | |
10 | #define FIREFLY3D_SCREEN_HEIGHT 64 | |
11 | ||
12 | ||
13 | /** STUCTRURES **/ | |
14 | ||
15 | typedef struct | |
16 | { | |
17 | int x, y, z; | |
18 | char color; | |
19 | } Point_3D; | |
20 | ||
21 | typedef struct | |
22 | { | |
23 | Point_3D* points[2]; | |
24 | char color; | |
25 | } Line_3D; | |
26 | ||
27 | typedef struct | |
28 | { | |
29 | Line_3D* lines[3]; | |
30 | char color; | |
31 | } Face_3D; | |
32 | ||
33 | typedef struct | |
34 | { | |
35 | int nbFaces; | |
36 | Face_3D** faces; | |
37 | } Object_3D; | |
38 | ||
39 | typedef struct | |
40 | { | |
41 | int x, y, z; | |
42 | } Translation_vector; | |
43 | ||
44 | typedef struct | |
45 | { | |
46 | fix x, y, z; | |
47 | } Rotation_vector; | |
48 | ||
49 | typedef struct | |
50 | { | |
51 | int focal_length; | |
52 | Point_3D position; | |
53 | Rotation_vector orientation; | |
54 | } Camera_3D; | |
55 | ||
56 | ||
57 | /** FUNCTIONS **/ | |
58 | ||
59 | void FF_translate_point(Point_3D* point, Translation_vector translation); | |
60 | void FF_rotation_point(Point_3D* point, Point_3D rotation_center, Rotation_vector rotation); | |
61 | ||
62 | void FF_place_point_3D(Point_3D* point, int x, int y, int z, int color); | |
63 | Point_3D* FF_new_point_3D(int x, int y, int z, int color); | |
64 | ||
65 | void FF_alloc_line_3D(Line_3D* line, Point_3D* point_0, Point_3D* point_1, int color); | |
66 | ||
67 | void FF_alloc_face_3D(Face_3D* face, Line_3D* line_0, Line_3D* line_1, Line_3D* line_2, int color); | |
68 | ||
69 | void FF_draw_point_fixed_camera(Point_3D point, int focale); | |
70 | void FF_draw_line_fixed_camera(Line_3D line, int focale); | |
71 | void FF_draw_face_fixed_camera(Face_3D face, int focale); | |
72 | ||
73 | #endif |