summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-3d-primitives.h
blob: c08ae6555b217fabe8b1243e3c2cb8bee5fc92f9 (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
56
57
58
59
#ifndef EVAS_3D_PRIMITIVES_H
#define EVAS_3D_PRIMITIVES_H

#include <Eo.h>
#include <Evas.h>
#include <math.h>

// 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);

/* Set frame as terrain generated by perlin noise algorithm*/
void
evas_3d_add_terrain_frame(Eo *mesh, int frame, int precision, vec2 tex_scale);

#endif // EVAS_3D_PRIMITIVES_H