summaryrefslogtreecommitdiff log msg author committer range
blob: 3281f5d81b7c74d928c03ed17b94bd4c62ed5d06 (plain) (blame)
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 ``` ``````#ifndef EVAS_3D_PRIMITIVES_H #define EVAS_3D_PRIMITIVES_H #include #include #include // TODO Use an external library of linear algebra. typedef struct _vec3 { float x; float y; float z; } vec3; typedef struct _vec2 { float x; float y; } vec2; /* The type of user-defined parametric surface function.*/ typedef vec3 (Surface)(float x, float y); /* Set frame as sphere. */ void evas_3d_add_sphere_frame(Eo *mesh, int frame, int precision, vec2 tex_scale); /* Set frame as user defined parametric surface.A parametric surface is a * surface in the Euclidean space R3 which is defined by a parametric equation * with two parameters. */ void evas_3d_add_func_surface_frame(Eo *mesh, int frame, Surface func, int precision, vec2 tex_scale); /* Set frame as sphere as torus */ void evas_3d_add_torus_frame(Eo *mesh, int frame, float rratio, int precision, vec2 tex_scale); /* Set frame as cylinder. */ void evas_3d_add_cylinder_frame(Eo *mesh, int frame, int precision, vec2 tex_scale); /* Set frame as cone. */ void evas_3d_add_cone_frame(Eo *mesh, int frame, int precision, vec2 tex_scale); /* Set frame as square. */ void evas_3d_add_square_frame(Eo *mesh, int frame); /* Set frame as cube. */ void evas_3d_add_cube_frame(Eo *mesh, int frame); #endif // EVAS_3D_PRIMITIVES_H ``````