cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0972211144adcf09170d41ceacb62788fb954651

commit 0972211144adcf09170d41ceacb62788fb954651
Author: Bogdan Devichev <b.devic...@samsung.com>
Date:   Fri May 29 18:14:08 2015 +0200

    evas: Evas_3D examples use new API for creating primitives.
    
    Summary: Examples changed due to D2516
    
    Reviewers: Oleksander, Hermet, raster, cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2517
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/examples/evas/Makefile.am                      |  22 +-
 src/examples/evas/evas-3d-aabb.c                   |  17 +-
 src/examples/evas/evas-3d-blending.c               |  26 +-
 src/examples/evas/evas-3d-colorpick.c              |  11 +-
 src/examples/evas/evas-3d-cube-rotate.c            |  14 +-
 src/examples/evas/evas-3d-cube2.c                  |  11 +-
 src/examples/evas/evas-3d-fog.c                    |  27 +-
 src/examples/evas/evas-3d-frustum.c                |  31 +-
 src/examples/evas/evas-3d-parallax-occlusion.c     |  14 +-
 src/examples/evas/evas-3d-pick.c                   |  12 +-
 src/examples/evas/evas-3d-primitives.c             | 620 ---------------------
 src/examples/evas/evas-3d-primitives.h             |  59 --
 src/examples/evas/evas-3d-proxy.c                  |  11 +-
 src/examples/evas/evas-3d-shadows.c                |  72 ++-
 src/examples/evas/shooter/evas-3d-shooter-header.h |   2 +-
 src/examples/evas/shooter/evas-3d-shooter-macros.h |  12 +
 src/examples/evas/shooter/evas-3d-shooter.c        |  16 +-
 17 files changed, 197 insertions(+), 780 deletions(-)

diff --git a/src/examples/evas/Makefile.am b/src/examples/evas/Makefile.am
index 986ad9a..522345c 100644
--- a/src/examples/evas/Makefile.am
+++ b/src/examples/evas/Makefile.am
@@ -205,17 +205,17 @@ evas_3d_cube_LDADD = $(ECORE_EVAS_COMMON_LDADD) 
@EFL_PTHREAD_LIBS@
 evas_3d_cube_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_cube2
-evas_3d_cube2_SOURCES = evas-3d-cube2.c evas-3d-primitives.c 
evas-3d-primitives.h
+evas_3d_cube2_SOURCES = evas-3d-cube2.c
 evas_3d_cube2_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_cube2_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_proxy
-evas_3d_proxy_SOURCES = evas-3d-proxy.c evas-3d-primitives.c 
evas-3d-primitives.h
+evas_3d_proxy_SOURCES = evas-3d-proxy.c
 evas_3d_proxy_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_proxy_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_pick
-evas_3d_pick_SOURCES = evas-3d-pick.c evas-3d-primitives.c evas-3d-primitives.h
+evas_3d_pick_SOURCES = evas-3d-pick.c
 evas_3d_pick_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_pick_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
@@ -235,27 +235,27 @@ evas_3d_ply_LDADD = $(ECORE_EVAS_COMMON_LDADD) 
@EFL_PTHREAD_LIBS@
 evas_3d_ply_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_frustum
-evas_3d_frustum_SOURCES = evas-3d-frustum.c evas-3d-primitives.c 
evas-3d-primitives.h
+evas_3d_frustum_SOURCES = evas-3d-frustum.c
 evas_3d_frustum_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_frustum_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_aabb
-evas_3d_aabb_SOURCES = evas-3d-aabb.c evas-3d-primitives.c evas-3d-primitives.h
+evas_3d_aabb_SOURCES = evas-3d-aabb.c
 evas_3d_aabb_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_aabb_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_cube_rotate
-evas_3d_cube_rotate_SOURCES = evas-3d-cube-rotate.c evas-3d-primitives.c 
evas-3d-primitives.h
+evas_3d_cube_rotate_SOURCES = evas-3d-cube-rotate.c
 evas_3d_cube_rotate_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_cube_rotate_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_shadows
-evas_3d_shadows_SOURCES = evas-3d-shadows.c evas-3d-primitives.c 
evas-3d-primitives.h
+evas_3d_shadows_SOURCES = evas-3d-shadows.c
 evas_3d_shadows_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_shadows_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_shooter
-evas_3d_shooter_SOURCES = shooter/evas-3d-shooter.c 
shooter/evas-3d-shooter-header.c evas-3d-primitives.c evas-3d-primitives.h
+evas_3d_shooter_SOURCES = shooter/evas-3d-shooter.c 
shooter/evas-3d-shooter-header.c
 evas_3d_shooter_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_shooter_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
@@ -265,7 +265,7 @@ evas_3d_obj_LDADD = $(ECORE_EVAS_COMMON_LDADD) 
@EFL_PTHREAD_LIBS@
 evas_3d_obj_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_blending
-evas_3d_blending_SOURCES = evas-3d-blending.c evas-3d-primitives.c
+evas_3d_blending_SOURCES = evas-3d-blending.c
 evas_3d_blending_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_blending_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
@@ -275,12 +275,12 @@ evas_3d_mmap_LDADD = $(ECORE_EVAS_COMMON_LDADD) 
@EFL_PTHREAD_LIBS@
 evas_3d_mmap_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_colorpick
-evas_3d_colorpick_SOURCES = evas-3d-colorpick.c evas-3d-primitives.c
+evas_3d_colorpick_SOURCES = evas-3d-colorpick.c
 evas_3d_colorpick_LDADD = $(ECORE_EVAS_COMMON_LDADD) @EFL_PTHREAD_LIBS@
 evas_3d_colorpick_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
 EXTRA_PROGRAMS += evas_3d_parallax_occlusion
-evas_3d_parallax_occlusion_SOURCES = evas-3d-parallax-occlusion.c 
evas-3d-primitives.c
+evas_3d_parallax_occlusion_SOURCES = evas-3d-parallax-occlusion.c
 evas_3d_parallax_occlusion_LDADD = $(ECORE_EVAS_COMMON_LDADD) 
@EFL_PTHREAD_LIBS@
 evas_3d_parallax_occlusion_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS)
 
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index 9f9488a..6a9d905 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -5,7 +5,7 @@
  * Rotate axises (keys 1-4) for model and bounding box view from another angle.
  *
  * @verbatim
- * gcc -o evas-3d-aabb evas-3d-aabb.c evas-3d-primitives.c `pkg-config --libs 
--cflags efl evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas 
ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -22,7 +22,6 @@
 #include <Ecore.h>
 #include <Ecore_Evas.h>
 #include "evas-common.h"
-#include "evas-3d-primitives.h"
 
 #define  WIDTH 400
 #define  HEIGHT 400
@@ -34,7 +33,7 @@ Ecore_Evas *ecore_evas = NULL;
 Evas *evas = NULL;
 Eo *background = NULL;
 Eo *image = NULL;
-
+Eo *cube = NULL;
 Eo *scene = NULL;
 Eo *root_node = NULL;
 Eo *camera_node = NULL;
@@ -218,12 +217,16 @@ main(void)
    material_box = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
    eo_do(material_box, evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, 
EINA_TRUE));
 
+   cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    mesh_box = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(mesh_box, 0);
    eo_do(mesh_box,
-          evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
-          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
-          evas_3d_mesh_frame_material_set(0, material_box));
+         evas_3d_mesh_from_primitive_set(0, cube),
+         evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
+         evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_VERTEX_COLOR),
+         evas_3d_mesh_frame_material_set(0, material_box));
     _redraw_aabb();
 
    eo_do(root_node,
diff --git a/src/examples/evas/evas-3d-blending.c 
b/src/examples/evas/evas-3d-blending.c
index b40be0c..790ba44 100644
--- a/src/examples/evas/evas-3d-blending.c
+++ b/src/examples/evas/evas-3d-blending.c
@@ -4,7 +4,7 @@
  * For more detailes see 
https://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml
  *
  * @verbatim
- * gcc -o evas-3d-blending evas-3d-blending.c evas-3d-primitives.c `pkg-config 
--libs --cflags efl evas ecore ecore-evas eo`-lm
+ * gcc -o evas-3d-blending evas-3d-blending.c `pkg-config --libs --cflags efl 
evas ecore ecore-evas eo`-lm
  * @endverbatim
  */
 
@@ -15,7 +15,6 @@
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include "evas-3d-primitives.h"
 
 #define  WIDTH          1024
 #define  HEIGHT         1024
@@ -67,12 +66,11 @@ typedef struct _Scene_Data
    Eo     *light;
    Eo     *mesh;
    Eo     *mesh1;
+   Eo     *sphere;
    Eo     *material;
    Eo     *material1;
 } Scene_Data;
 
-static const vec2 tex_scale = {1, 1};
-
 Evas             *evas        = NULL;
 Eo               *background  = NULL;
 Eo               *image       = NULL;
@@ -185,11 +183,10 @@ _light_setup(Scene_Data *data)
 }
 
 static void
-_set_ball(Eo *mesh, int p, Evas_3D_Material *material)
+_set_ball(Eo *mesh, Eo *sphere, Evas_3D_Material *material)
 {
-
-   evas_3d_add_sphere_frame(mesh, 0, p, tex_scale);
    eo_do(mesh,
+         evas_3d_mesh_from_primitive_set(0, sphere),
          evas_3d_mesh_frame_material_set(0, material),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
 }
@@ -221,11 +218,16 @@ _mesh_setup(Scene_Data *data)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
0.2),
          evas_3d_material_shininess_set(100.0));
 
+   data->sphere = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->sphere,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(50));
+
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
    data->mesh1 = eo_add(EVAS_3D_MESH_CLASS, evas);
 
-   _set_ball(data->mesh, 50, data->material);
-   _set_ball(data->mesh1, 50, data->material1);
+   _set_ball(data->mesh, data->sphere, data->material);
+   _set_ball(data->mesh1, data->sphere, data->material1);
 
    data->mesh_node =
       eo_add(EVAS_3D_NODE_CLASS, evas,
@@ -245,12 +247,10 @@ _mesh_setup(Scene_Data *data)
       evas_3d_mesh_blending_func_set(func1, func2));
 
    eo_do(data->mesh_node,
-         evas_3d_node_scale_set(2.0, 2.0, 2.0),
-         evas_3d_node_orientation_angle_axis_set(90.0, 1.0, 0.0, 0.0));
+         evas_3d_node_scale_set(2.0, 2.0, 2.0));
 
    eo_do(data->mesh_node1,
-         evas_3d_node_scale_set(5.0, 5.0, 5.0),
-         evas_3d_node_orientation_angle_axis_set(90.0, 1.0, 0.0, 0.0));
+         evas_3d_node_scale_set(5.0, 5.0, 5.0));
 }
 
 static void
diff --git a/src/examples/evas/evas-3d-colorpick.c 
b/src/examples/evas/evas-3d-colorpick.c
index 3fb7adb..215c455 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -9,7 +9,7 @@
  * p - precision of the spheres, t - path for a texture.
  *
  * @verbatim
- * gcc -o evas-3d-colorpick evas-3d-colorpick.c evas-3d-primitives.c 
`pkg-config --libs --cflags evas ecore ecore-evas eo eina efl` -lm
+ * gcc -o evas-3d-colorpick evas-3d-colorpick.c `pkg-config --libs --cflags 
evas ecore ecore-evas eo eina efl` -lm
  * @endverbatim
  */
 
@@ -27,7 +27,6 @@
 #include <Ecore_Evas.h>
 #include <Ecore_Getopt.h>
 #include <math.h>
-#include "evas-3d-primitives.h"
 #include "evas-common.h"
 
 #define  WIDTH 800
@@ -40,7 +39,6 @@
 #define SCALE_UNIT 0.5
 #define VEC_3(value) value, value, value
 
-static const vec2 tex_scale = {1, 1};
 static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER 
"/wood.jpg";
 
 Ecore_Evas *ecore_evas = NULL;
@@ -68,6 +66,7 @@ Ecore_Getopt optdesc = {
 
  typedef struct _Object
  {
+   Eo *primitive;
    Eo *node;
    Eo *mesh;
    Eo *material;
@@ -243,10 +242,14 @@ Eina_Bool
 _init_sphere(void *this, const char *texture)
 {
    Test_object *sphere  = (Test_object *)this;
+   sphere->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
    sphere->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
    sphere->material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
-   evas_3d_add_sphere_frame(sphere->mesh, 0, globalscene.precision, tex_scale);
+   eo_do(sphere->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(50));
    eo_do(sphere->mesh,
+         evas_3d_mesh_from_primitive_set(0, sphere->primitive),
          evas_3d_mesh_frame_material_set(0, sphere->material),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG));
 
diff --git a/src/examples/evas/evas-3d-cube-rotate.c 
b/src/examples/evas/evas-3d-cube-rotate.c
index 8df3292..3eb63f6 100644
--- a/src/examples/evas/evas-3d-cube-rotate.c
+++ b/src/examples/evas/evas-3d-cube-rotate.c
@@ -8,7 +8,7 @@
  * is pressed. Note, that rotation is taking place around one axis only.
  *
  * @verbatim
- * gcc -o evas-3d-cube-rotate evas-3d-cube-rotate.c evas-3d-primitives.c -g 
`pkg-config --libs --cflags evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-cube-rotate evas-3d-cube-rotate.c -g `pkg-config --libs 
--cflags evas ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -19,8 +19,6 @@
 #include <Ecore_Evas.h>
 #include <Evas.h>
 #include <Eo.h>
-#include "evas-3d-primitives.h"
-
 
 #define  WIDTH          400
 #define  HEIGHT         400
@@ -35,6 +33,7 @@ typedef struct _Scene_Data
 
    Eo               *camera;
    Eo               *light;
+   Eo               *cube;
    Eo               *mesh;
    Eo               *material;
    float            angle;
@@ -48,7 +47,7 @@ Ecore_Evas       *ecore_evas  = NULL;
 Evas             *evas        = NULL;
 Eo               *background  = NULL;
 Eo               *image       = NULL;
-static float     angle        = 0.0;
+static float     angle        = 0.0f;
 float            d_angle      = 0.5;
 
 static void
@@ -200,10 +199,15 @@ _mesh_setup(Scene_Data *data)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_shininess_set(100.0));
 
+   /* Setup primitive */
+   data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    /* Setup mesh. */
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(data->mesh, 0);
    eo_do(data->mesh,
+         evas_3d_mesh_from_primitive_set(0, data->cube),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG),
          evas_3d_mesh_frame_material_set(0, data->material));
 
diff --git a/src/examples/evas/evas-3d-cube2.c 
b/src/examples/evas/evas-3d-cube2.c
index e438973..4f43c7c 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -3,7 +3,7 @@
  * by interpolation between frames.
  *
  * @verbatim
- * gcc -o evas-3d-cube2 evas-3d-cube2.c evas-3d-primitives.c `pkg-config 
--libs --cflags efl evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-cube2 evas-3d-cube2.c `pkg-config --libs --cflags efl evas 
ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -19,7 +19,6 @@
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include "evas-3d-primitives.h"
 #include "evas-common.h"
 
 #define  WIDTH          400
@@ -37,6 +36,7 @@ typedef struct _Scene_Data
 
    Eo *camera;
    Eo *light;
+   Eo *cube;
    Eo *mesh;
    Eo *material0;
    Eo *material1;
@@ -195,10 +195,15 @@ _mesh_setup(Scene_Data *data)
    eo_do(data->material1,
          evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, 
data->texture_normal));
 
+   /* Set data of primitive */
+   data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    /* Setup mesh. */
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(data->mesh, 0);
    eo_do(data->mesh,
+         evas_3d_mesh_from_primitive_set(0, data->cube),
          evas_3d_mesh_frame_material_set(0, data->material0),
          evas_3d_mesh_frame_add(20),
          evas_3d_mesh_frame_material_set(20, data->material1),
diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c
index df70644..5154288 100644
--- a/src/examples/evas/evas-3d-fog.c
+++ b/src/examples/evas/evas-3d-fog.c
@@ -2,7 +2,7 @@
  * Example illustrating usage of fog effect.
  *
  * @verbatim
- * gcc -o evas-3d-fog evas-3d-fog.c evas-3d-primitives.c `pkg-config --libs 
--cflags efl evas ecore ecore-evas eo`-lm
+ * gcc -o evas-3d-fog evas-3d-fog.c `pkg-config --libs --cflags efl evas ecore 
ecore-evas eo`-lm
  * @endverbatim
  */
 
@@ -14,7 +14,6 @@
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include "evas-3d-primitives.h"
 
 #define  WIDTH          1024
 #define  HEIGHT         1024
@@ -32,6 +31,7 @@ typedef struct _Scene_Data
    Eo     *mesh_node;
    Eo     *mesh_node1;
    Eo     *animation_node;
+   Eo     *sphere;
 
    Eo     *camera;
    Eo     *light;
@@ -40,8 +40,6 @@ typedef struct _Scene_Data
    Eo     *material;
 } Scene_Data;
 
-static const vec2 tex_scale = {1, 1};
-
 Ecore_Evas       *ecore_evas  = NULL;
 Evas             *evas        = NULL;
 Eo               *background  = NULL;
@@ -95,7 +93,7 @@ _camera_setup(Scene_Data *data)
 
   eo_do(data->camera_node,
          evas_3d_node_camera_set(data->camera),
-         evas_3d_node_position_set(0.0, 0.0, 10.0),
+         evas_3d_node_position_set(0.0, 0.0, 7.0),
          evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0,
                                   EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0));
 
@@ -123,12 +121,12 @@ _light_setup(Scene_Data *data)
 }
 
 static void
-_set_ball(Eo *mesh, int p, Evas_3D_Material *material)
+_set_ball(Eo *mesh, Eo *sphere, Evas_3D_Material *material)
 {
-   evas_3d_add_sphere_frame(mesh, 0, p, tex_scale);
-
-   eo_do(mesh, evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG),
-               evas_3d_mesh_frame_material_set(0, material));
+   eo_do(mesh, 
+         evas_3d_mesh_from_primitive_set(0, sphere),
+         evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG),
+         evas_3d_mesh_frame_material_set(0, material));
 }
 
 
@@ -147,11 +145,16 @@ _mesh_setup(Scene_Data *data)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_shininess_set(100.0));
 
+   data->sphere = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->sphere,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(50));
+
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
    data->mesh1 = eo_add(EVAS_3D_MESH_CLASS, evas);
 
-   _set_ball(data->mesh, 100, data->material);
-   _set_ball(data->mesh1, 100, data->material);
+   _set_ball(data->mesh, data->sphere, data->material);
+   _set_ball(data->mesh1, data->sphere, data->material);
 
    data->animation_node =
       eo_add(EVAS_3D_NODE_CLASS, evas,
diff --git a/src/examples/evas/evas-3d-frustum.c 
b/src/examples/evas/evas-3d-frustum.c
index efeb8b3..d3e9f81 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -10,7 +10,7 @@
  * @see evas_3d_camera_node_visible_get.
  *
  * @verbatim
- * gcc -o evas-3d-frustum evas-3d-frustum.c evas-3d-primitives.c `pkg-config 
--libs --cflags efl evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl 
evas ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -28,7 +28,6 @@
 #include <Eo.h>
 #include <math.h>
 #include "evas-common.h"
-#include "evas-3d-primitives.h"
 
 #define  WIDTH          800
 #define  HEIGHT         600
@@ -47,6 +46,8 @@ typedef struct _Scene_Data
    Eo *camera;
    Eo *light;
    Eo *mesh_model;
+   Eo *sphere;
+   Eo *cube;
    Eo *mesh_sphere;
    Eo *mesh_aabb;
    Eo *material_model;
@@ -60,7 +61,6 @@ Evas_Real obj_x = 0.0, obj_y = 0.0, obj_z = 0.0, obj_sc_x = 
10.0, obj_sc_y = 10.
 Evas_Real fleft = -5, fright = 5, fbottom = -5, fup = 5, fnear = 20, ffar = 
1000;
 Evas_Real radius = 0;
 Evas_3D_Frustum_Mode key = EVAS_3D_FRUSTUM_MODE_AABB;
-static const vec2 tex_scale = {1, 1};
 
 static void
 _show_help()
@@ -343,19 +343,28 @@ _mesh_setup(Scene_Data *data)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_shininess_set(100.0));
 
+   data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
+   data->sphere = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->sphere,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(20));
+
    data->mesh_aabb = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(data->mesh_aabb, 0);
    eo_do(data->mesh_aabb,
-          evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
-          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
-          evas_3d_mesh_frame_material_set(0, data->material));
+         evas_3d_mesh_from_primitive_set(0, data->cube),
+         evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
+         evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
+         evas_3d_mesh_frame_material_set(0, data->material));
 
    data->mesh_sphere = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_sphere_frame(data->mesh_sphere, 0, 20, tex_scale);
    eo_do(data->mesh_sphere,
-          evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
-          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
-          evas_3d_mesh_frame_material_set(0, data->material));
+         evas_3d_mesh_from_primitive_set(0, data->sphere),
+         evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_LINES),
+         evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
+         evas_3d_mesh_frame_material_set(0, data->material));
 
    data->mesh_node =
       eo_add(EVAS_3D_NODE_CLASS, evas, 
evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH));
diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c 
b/src/examples/evas/evas-3d-parallax-occlusion.c
index ec44e24..33b1e43 100644
--- a/src/examples/evas/evas-3d-parallax-occlusion.c
+++ b/src/examples/evas/evas-3d-parallax-occlusion.c
@@ -4,7 +4,7 @@
  * Press "n" for use normal mapping shading. Pres "p" for use parallax 
occlusion mapping shading.
  *
  * @verbatim
- * gcc -o evas-3d-parallax-occlusion evas-3d-parallax-occlusion.c 
evas-3d-primitives.c `pkg-config --libs --cflags efl evas ecore ecore-evas 
eo`-lm
+ * gcc -o evas-3d-parallax-occlusion evas-3d-parallax-occlusion.c `pkg-config 
--libs --cflags evas ecore ecore-evas eo efl`-lm
  * @endverbatim
  */
 
@@ -20,7 +20,6 @@
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include "evas-3d-primitives.h"
 #include "evas-common.h"
 
 #define  WIDTH          400
@@ -42,6 +41,7 @@ typedef struct _Scene_Data
    Eo *camera;
    Eo *light;
    Eo *mesh;
+   Eo *cube;
    Eo *material_rocks;
    Eo *material_wood;
    Eo *texture_rocks;
@@ -195,12 +195,16 @@ _mesh_setup(Scene_Data *data)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_shininess_set(100.0));
 
+   /* Set data of primitive */
+   data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    /* Setup mesh. */
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(data->mesh, 0);
-
-   evas_3d_add_cube_frame(data->mesh, 100);
    eo_do(data->mesh,
+         evas_3d_mesh_from_primitive_set(0, data->cube),
+         evas_3d_mesh_from_primitive_set(100, data->cube),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PARALLAX_OCCLUSION),
          evas_3d_mesh_frame_material_set(0, data->material_rocks));
 
diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c
index 16b380c..9e8e19b 100644
--- a/src/examples/evas/evas-3d-pick.c
+++ b/src/examples/evas/evas-3d-pick.c
@@ -6,7 +6,7 @@
  * and parameters which can be got from this function.
  *
  * @verbatim
- * gcc -o evas-3d-pick evas-3d-pick.c evas-3d-primitives.c `pkg-config --libs 
--cflags efl evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-pick evas-3d-pick.c `pkg-config --libs --cflags efl evas 
ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -24,7 +24,6 @@
 #include <Ecore.h>
 #include <Ecore_Evas.h>
 #include "evas-common.h"
-#include "evas-3d-primitives.h"
 
 #define  WIDTH          400
 #define  HEIGHT         400
@@ -43,7 +42,7 @@ static Eo *mesh_node = NULL;
 static Eo *mesh = NULL;
 static Eo *material = NULL;
 static Eo *texture_diffuse = NULL;
-static const vec2 tex_scale = {1, 1};
+static Eo *sphere = NULL;
 
 static Eina_Bool
 _animate_scene(void *data)
@@ -155,10 +154,13 @@ main(void)
                                   EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0));
    eo_do(root_node, evas_3d_node_member_add(camera_node));
 
-   /* Add the cube mesh. */
+   sphere = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(sphere,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(50));
 
    mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_sphere_frame(mesh, 0, 100, tex_scale);
+   eo_do(mesh, evas_3d_mesh_from_primitive_set(0, sphere));
 
    material = eo_add(EVAS_3D_MATERIAL_CLASS, evas);
 
diff --git a/src/examples/evas/evas-3d-primitives.c 
b/src/examples/evas/evas-3d-primitives.c
deleted file mode 100644
index 393ee16..0000000
--- a/src/examples/evas/evas-3d-primitives.c
+++ /dev/null
@@ -1,620 +0,0 @@
-#define EFL_EO_API_SUPPORT
-#define EFL_BETA_API_SUPPORT
-
-#include "evas-3d-primitives.h"
-
-// TODO Use an external library of linear algebra.
-inline void
-_vec3_subtract(vec3 *out, const vec3 *a, const vec3 *b)
-{
-   out->x = a->x - b->x;
-   out->y = a->y - b->y;
-   out->z = a->z - b->z;
-}
-
-inline void
-_vec3_copy(vec3 *dst, const vec3 *src)
-{
-   dst->x = src->x;
-   dst->y = src->y;
-   dst->z = src->z;
-}
-
-inline void
-_vec3_cross_product(vec3 *out, const vec3 *a, const vec3 *b)
-{
-   vec3 tmp;
-
-   tmp.x = a->y * b->z - a->z * b->y;
-   tmp.y = a->z * b->x - a->x * b->z;
-   tmp.z = a->x * b->y - a->y * b->x;
-
-   _vec3_copy(out, &tmp);
-}
-
-inline void
-_vec3_normalize(vec3 *out)
-{
-   float size = out->x * out->x + out->y *out->y + out->z * out->z;
-   size = sqrt(size);
-   out->x /= size;
-   out->y /= size;
-   out->z /= size;
-}
-
-const float cube_vertices[] =
-{
-   /* Front */
-   -0.5,  0.5,  0.5,     0.0,  0.0,  1.0,     1.0, 0.0, 0.0, 1.0,     0.0,  
1.0,      1.0, 0.0, 0.0,
-    0.5,  0.5,  0.5,     0.0,  0.0,  1.0,     1.0, 0.0, 0.0, 1.0,     1.0,  
1.0,      1.0, 0.0, 0.0,
-   -0.5, -0.5,  0.5,     0.0,  0.0,  1.0,     1.0, 0.0, 0.0, 1.0,     0.0,  
0.0,      1.0, 0.0, 0.0,
-    0.5, -0.5,  0.5,     0.0,  0.0,  1.0,     1.0, 0.0, 0.0, 1.0,     1.0,  
0.0,      1.0, 0.0, 0.0,
-
-   /* Back */
-    0.5,  0.5, -0.5,     0.0,  0.0, -1.0,     0.0, 0.0, 1.0, 1.0,     0.0,  
1.0,     -1.0, 0.0, 0.0,
-   -0.5,  0.5, -0.5,     0.0,  0.0, -1.0,     0.0, 0.0, 1.0, 1.0,     1.0,  
1.0,     -1.0, 0.0, 0.0,
-    0.5, -0.5, -0.5,     0.0,  0.0, -1.0,     0.0, 0.0, 1.0, 1.0,     0.0,  
0.0,     -1.0, 0.0, 0.0,
-   -0.5, -0.5, -0.5,     0.0,  0.0, -1.0,     0.0, 0.0, 1.0, 1.0,     1.0,  
0.0,     -1.0, 0.0, 0.0,
-
-   /* Left */
-   -0.5,  0.5, -0.5,    -1.0,  0.0,  0.0,     0.0, 1.0, 0.0, 1.0,     0.0,  
1.0,     0.0, 0.0, 1.0,
-   -0.5,  0.5,  0.5,    -1.0,  0.0,  0.0,     0.0, 1.0, 0.0, 1.0,     1.0,  
1.0,     0.0, 0.0, 1.0,
-   -0.5, -0.5, -0.5,    -1.0,  0.0,  0.0,     0.0, 1.0, 0.0, 1.0,     0.0,  
0.0,     0.0, 0.0, 1.0,
-   -0.5, -0.5,  0.5,    -1.0,  0.0,  0.0,     0.0, 1.0, 0.0, 1.0,     1.0,  
0.0,     0.0, 0.0, 1.0,
-
-   /* Right */
-    0.5,  0.5,  0.5,     1.0,  0.0,  0.0,     1.0, 1.0, 0.0, 1.0,     0.0,  
1.0,     0.0, 0.0, -1.0,
-    0.5,  0.5, -0.5,     1.0,  0.0,  0.0,     1.0, 1.0, 0.0, 1.0,     1.0,  
1.0,     0.0, 0.0, -1.0,
-    0.5, -0.5,  0.5,     1.0,  0.0,  0.0,     1.0, 1.0, 0.0, 1.0,     0.0,  
0.0,     0.0, 0.0, -1.0,
-    0.5, -0.5, -0.5,     1.0,  0.0,  0.0,     1.0, 1.0, 0.0, 1.0,     1.0,  
0.0,     0.0, 0.0, -1.0,
-
-   /* Top */
-   -0.5,  0.5, -0.5,     0.0,  1.0,  0.0,     1.0, 0.0, 1.0, 1.0,     0.0,  
1.0,     1.0, 0.0, 0.0,
-    0.5,  0.5, -0.5,     0.0,  1.0,  0.0,     1.0, 0.0, 1.0, 1.0,     1.0,  
1.0,     1.0, 0.0, 0.0,
-   -0.5,  0.5,  0.5,     0.0,  1.0,  0.0,     1.0, 0.0, 1.0, 1.0,     0.0,  
0.0,     1.0, 0.0, 0.0,
-    0.5,  0.5,  0.5,     0.0,  1.0,  0.0,     1.0, 0.0, 1.0, 1.0,     1.0,  
0.0,     1.0, 0.0, 0.0,
-
-   /* Bottom */
-    0.5, -0.5, -0.5,     0.0, -1.0,  0.0,     0.0, 1.0, 1.0, 1.0,     0.0,  
1.0,     -1.0, 0.0, 0.0,
-   -0.5, -0.5, -0.5,     0.0, -1.0,  0.0,     0.0, 1.0, 1.0, 1.0,     1.0,  
1.0,     -1.0, 0.0, 0.0,
-    0.5, -0.5,  0.5,     0.0, -1.0,  0.0,     0.0, 1.0, 1.0, 1.0,     0.0,  
0.0,     -1.0, 0.0, 0.0,
-   -0.5, -0.5,  0.5,     0.0, -1.0,  0.0,     0.0, 1.0, 1.0, 1.0,     1.0,  
0.0,     -1.0, 0.0, 0.0,
-};
-
-const unsigned short cube_indices[] =
-{
-   0,   1,  2,  2,  1,  3,
-   4,   5,  6,  6,  5,  7,
-   8,   9, 10, 10,  9, 11,
-   12, 13, 14, 14, 13, 15,
-   16, 17, 18, 18, 17, 19,
-   20, 21, 22, 22, 21, 23
-};
-
-const float square_vertices[] =
-{
-   -0.5,  0.5,  0.0,     0.0,  0.0,  -1.0,     1.0, 0.0, 0.0, 1.0,     0.0,  
1.0,      1.0, 0.0, 0.0,
-    0.5,  0.5,  0.0,     0.0,  0.0,  -1.0,     1.0, 0.0, 0.0, 1.0,     1.0,  
1.0,      1.0, 0.0, 0.0,
-   -0.5, -0.5,  0.0,     0.0,  0.0,  -1.0,     1.0, 0.0, 0.0, 1.0,     0.0,  
0.0,      1.0, 0.0, 0.0,
-    0.5, -0.5,  0.0,     0.0,  0.0,  -1.0,     1.0, 0.0, 0.0, 1.0,     1.0,  
0.0,      1.0, 0.0, 0.0,
-};
-
-const unsigned short square_indices[] = {0, 1, 2, 2, 1, 3};
-
-#define ALLOCATE_VERTEX_DATA \
-   vec3 *vertices = malloc(sizeof(vec3) * vcount); \
-   vec3 *normals = malloc(sizeof(vec3) * vcount); \
-   vec2 *tex_coord = malloc(sizeof(vec2) * vcount); \
-   vec3 *tangents = malloc(sizeof(vec3) * vcount); \
-   unsigned short *indices = malloc(sizeof(short) * icount);
-
-#define SET_VERTEX_DATA(frame) \
-   eo_do(mesh, evas_3d_mesh_vertex_count_set(vcount), \
-         evas_3d_mesh_frame_add(frame), \
-         evas_3d_mesh_frame_vertex_data_copy_set(frame, 
EVAS_3D_VERTEX_POSITION, \
-                                       sizeof(vec3), &vertices[0]), \
-         evas_3d_mesh_frame_vertex_data_copy_set(frame, EVAS_3D_VERTEX_NORMAL, 
\
-                                       sizeof(vec3), &normals[0]), \
-         evas_3d_mesh_frame_vertex_data_copy_set(frame, 
EVAS_3D_VERTEX_TEXCOORD, \
-                                       sizeof(vec2), &tex_coord[0]), \
-         evas_3d_mesh_frame_vertex_data_copy_set(frame, 
EVAS_3D_VERTEX_TANGENT, \
-                                       sizeof(vec3), &tangents[0]), \
-         evas_3d_mesh_index_data_copy_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, 
\
-                                       icount, &indices[0])); \
-   free(vertices); \
-   free(normals); \
-   free(tangents); \
-   free(tex_coord); \
-   free(indices);
-
-#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, v_array, v_count, i_array, 
i_count) \
-   eo_do(mesh, \
-         evas_3d_mesh_vertex_count_set(v_count), \
-         evas_3d_mesh_frame_add(frame), \
-         evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_POSITION, \
-                                       15 * sizeof(float), &v_array[0]), \
-         evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_NORMAL, \
-                                       15 * sizeof(float), &v_array[3]), \
-         evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_COLOR, \
-                                       15 * sizeof(float), &v_array[6]), \
-         evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TEXCOORD, \
-                                       15 * sizeof(float), &v_array[10]), \
-         evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TANGENT, \
-                                       15 * sizeof(float), &v_array[12]), \
-         evas_3d_mesh_index_data_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, \
-                                       i_count, &i_array[0]), \
-         evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES));
-
-vec3 _get_func_normal(Surface *func, float x, float y)
-{
-   vec3 v00, v01, v10, d1, d2, normal;
-
-   v00 = func(x, y);
-   v01 = func(x, y + 0.01);
-   v10 = func(x + 0.01, y);
-   _vec3_subtract(&d1, &v00, &v01);
-   _vec3_subtract(&d2, &v01, &v10);
-
-   _vec3_cross_product(&normal, &d1, &d2);
-
-   _vec3_normalize(&normal);
-
-   return normal;
-}
-
-static float
-_random(int x, int y)
-{
-   int k = x + y * 57;
-   k = (k << 13) ^ k;
-   return (1.0f - ((k * (k * k * 15731 + 789221) + 1376312589) & 0x7fffffff) /
-      1073741824.0f);
-}
-
-static float
-_smooth(float x, float y)
-{
-   float res;
-   res = (_random(x - 1, y - 1) + _random(x + 1, y - 1) +
-        _random(x - 1, y + 1) + _random(x + 1, y + 1) ) / 16;
-   res += (_random(x - 1, y) + _random(x + 1, y) +
-        _random(x, y - 1) + _random(x, y + 1)) / 8;
-   res += _random(x, y) / 4;
-   return res;
-}
-
-static float
-_interpolate(float a, float b, float x)
-{
-   float ft = x * M_PI;
-   float f = (1 - cosf(ft)) * 0.5;
-   return a * (1 - f) + b * f;
-}
-
-static float _noise(float x, float y)
-{
-   float ix = (int)(x);
-   float fx = x - ix;
-   float iy = (int)(y);
-   float fy = y - iy;
-
-   float v1 = _smooth(ix, iy);
-   float v2 = _smooth(ix + 1, iy);
-   float v3 = _smooth(ix, iy + 1);
-   float v4 = _smooth(ix + 1, iy + 1);
-
-   float i1 = _interpolate(v1, v2, fx);
-   float i2 = _interpolate(v3, v4, fx);
-
-   return _interpolate(i1, i2, fy);
-}
-
-static vec3
-_perlin_terrain(float x,float y)
-{
-   vec3 out;
-   float persistence = 0.5f;
-   float frequency = 5;
-   float amplitude = 1;
-   int i = 0;
-   int octaves = 5;
-
-   out.x = x;
-   x += 0.5;
-   out.y = y;
-   y += 0.5;
-   out.z = 0;
-
-   for(i = 0;i < octaves; i++)
-     {
-        out.z += _noise(x * frequency, y * frequency) * amplitude;
-
-        amplitude *= persistence;
-        frequency *= 2;
-     }
-
-   return out;
-}
-
-void
-_generate_grid_indices(unsigned short *indices, int count)
-{
-   int i, j;
-   unsigned short *index = &indices[0];
-   int vccount = count + 1;
-
-   for (j = 0; j < count; j++)
-     for (i = 0; i < count; i++)
-       {
-          *index++ = (i * vccount) + j;
-          *index++ = (i * vccount) + j + 1;
-          *index++ = ((i + 1) * vccount) + j;
-
-          *index++ = ((i + 1) * vccount) + j;
-          *index++ = (i * vccount) + j + 1;
-          *index++ = ((i + 1) * vccount) + j + 1;
-       }
-}
-
-void
-_generate_tape_indices(unsigned short *indices, int count)
-{
-   int i, vccount = count + 1;
-   unsigned short *index = &indices[0];
-
-   for (i = 0; i < count; i++)
-     {
-        *index++ = i;
-        *index++ = i + 1;
-        *index++ = i + 1 + vccount;
-
-        *index++ = i;
-        *index++ = i + vccount;
-        *index++ = i + vccount + 1;
-     }
-}
-
-void
-evas_3d_add_sphere_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
-{
-   int vcount, icount, vccount, i, j;
-   unsigned short *index;
-
-   vccount = p + 1;
-   vcount = vccount * vccount;
-   icount = p * p * 6;
-
-   ALLOCATE_VERTEX_DATA
-
-   /* Calculate vertices position of the sphere mesh by using
-      splitting of sphere by latitude and longitude. */
-   for (i = 0; i <= p; i++)
-     {
-        double lati, z, r, point_r;
-
-        point_r = 0.00001;//non-zero little value for correct tangents 
calculation.
-
-        lati = ((M_PI - 2 * point_r) * (double)i) / (double)p;
-        z = cos(lati + point_r);
-        r = fabs(sin(lati + point_r));
-
-        for (j = 0; j <= p; j++)
-          {
-             double longi;
-             int num = (i * (p + 1)) + j;
-
-             longi = (M_PI * 2.0 * (double)j) / (double)p;
-
-             normals[num].x = r * sin(longi);
-             normals[num].y = r * cos(longi);
-             normals[num].z = z;
-
-             vertices[num].x = normals[num].x / 2;
-             vertices[num].y = normals[num].y / 2;
-             vertices[num].z = normals[num].z / 2;
-
-             if (vertices[num].x > 0.0)
-               {
-                  tangents[num].x = -normals[num].z;
-                  tangents[num].y = normals[num].y;
-                  tangents[num].z = normals[num].x;
-               }
-             else
-               {
-                  tangents[num].x = normals[num].z;
-                  tangents[num].y = normals[num].y;
-                  tangents[num].z = -normals[num].x;
-               }
-
-             tex_coord[num].x = i / (float)(vccount - 1) * tex_scale.x;
-             tex_coord[num].y = tex_scale.y - j / (float)(vccount - 1) * 
tex_scale.y;
-          }
-     }
-
-   _generate_grid_indices(indices, p);
-
-   /* Triangulation of sphere mesh in appliance with buffer of indices. */
-   for (i = 0; i < icount; i += 3)
-     {
-        vec3 e1, e2;
-        float du1, du2, dv1, dv2, f;
-        vec3 tangent;
-        int num0, num1, num2;
-
-        num0 = indices[i + 0];
-        num1 = indices[i + 1];
-        num2 = indices[i + 2];
-
-        e1.x = vertices[num1].x - vertices[num0].x;
-        e1.y = vertices[num1].y - vertices[num0].y;
-        e1.z = vertices[num1].z - vertices[num0].z;
-
-        e2.x = vertices[num2].x - vertices[num0].x;
-        e2.y = vertices[num2].y - vertices[num0].y;
-        e2.z = vertices[num2].z - vertices[num0].z;
-
-        du1 = tex_coord[num1].x - tex_coord[num0].x;
-        dv1 = tex_coord[num1].y - tex_coord[num0].y;
-
-        du2 = tex_coord[num2].x - tex_coord[num0].x;
-        dv2 = tex_coord[num2].y - tex_coord[num0].y;
-
-        f = 1.0 / ((du1 * dv2) - (du2 * dv1));
-
-        tangent.x = f * ((dv2 * e1.x) - (dv1 * e2.x));
-        tangent.y = f * ((dv2 * e1.y) - (dv1 * e2.y));
-        tangent.z = f * ((dv2 * e1.z) - (dv1 * e2.z));
-
-        tangents[num0] = tangent;
-     }
-
-   /* Coupling between vertices by calculation of tangent parametr correct 
value. */
-   for (i = 0; i <= p; i++)
-     {
-        for (j = 0; j <= p; j++)
-          {
-             if (j == p)
-               {
-                  tangents[(i * (p  + 1)) + j] = tangents[i * (p + 1)];
-               }
-          }
-     }
-   SET_VERTEX_DATA(frame)
-}
-
-void
-_normalize(vec3 *vertices, vec3 *normals, int vcount)
-{
-   int i;
-   vec3 min, max;
-   min = max = vertices[0];
-
-#define CHECK_MIN_AND_MAX(coord)                \
-        if (min.coord > vertices[i].coord)      \
-          min.coord = vertices[i].coord;        \
-        else if (max.coord < vertices[i].coord) \
-          max.coord = vertices[i].coord;
-   for (i = 1; i < vcount; i++)
-     {
-        CHECK_MIN_AND_MAX(x)
-        CHECK_MIN_AND_MAX(y)
-        CHECK_MIN_AND_MAX(z)
-     }
-#undef CHECK_MIN_AND_MAX
-
-   for (i = 0; i < vcount; i++)
-     {
-        vertices[i].x = (vertices[i].x - min.x) / (max.x - min.x) - 0.5;
-        vertices[i].y = (vertices[i].y - min.y) / (max.y - min.y) - 0.5;
-        vertices[i].z = (vertices[i].z - min.z) / (max.z - min.z) - 0.5;
-
-        normals[i].x = normals[i].x / (max.x - min.x);
-        normals[i].y = normals[i].y / (max.y - min.y);
-        normals[i].z = normals[i].z / (max.z - min.z);
-     }
-}
-
-void
-evas_3d_add_func_surface_frame(Eo *mesh, int frame, Surface func, int p, vec2 
tex_scale)
-{
-   int vcount, icount, vccount, i, j;
-   icount = p * p * 6;
-   vccount = p + 1;
-   vcount = vccount * vccount;
-
-   ALLOCATE_VERTEX_DATA
-
-   double v, u, d = 1.0 / p;
-
-   for (j = 0; j < vccount; j++)
-     {
-        u = j * d - 0.5;
-        for (i = 0; i < vccount; i++)
-          {
-             v = i * d - 0.5;
-             vertices[i + j * vccount] = func(v, u);
-             normals[i + j * vccount] = _get_func_normal(func, v, u);
-
-             // TODO Add tangent calculation
-             tangents[i + j * vccount].x = 0;
-             tangents[i + j * vccount].y = 0;
-             tangents[i + j * vccount].z = 0;
-
-             tex_coord[i + j * vccount].x = i / (float)(vccount - 1) * 
tex_scale.x;
-             tex_coord[i + j *vccount].y = tex_scale.y - j / (float)(vccount - 
1) * tex_scale.y;
-          }
-     }
-
-   _normalize(vertices, normals, vcount);
-   _generate_grid_indices(indices, p);
-   SET_VERTEX_DATA(frame)
-}
-
-void
-evas_3d_add_terrain_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
-{
-   evas_3d_add_func_surface_frame(mesh, frame, _perlin_terrain, p, tex_scale);
-}
-
-void
-evas_3d_add_torus_frame(Eo *mesh, int frame, float ratio, int p, vec2 
tex_scale)
-{
-   int vcount, icount, vccount, i, j;
-   icount = p * p * 6;
-   vccount = p + 1;
-   vcount = vccount * vccount;
-
-   ALLOCATE_VERTEX_DATA
-
-   double d, sinth, costh, fi, theta, sinfi, cosfi;
-
-   d = 2 * M_PI / p;
-
-   float rratio;
-
-   if ((ratio > 1.0) || (ratio < 0.0))
-     {
-        printf("Ratio of torus should be between 0.0 and 1.0. \n");
-        printf("Ratio = %f is a bad value, so 0.25 is used like default 
ratio.\n",
-                ratio);
-        rratio = 0.25;
-     }
-   else
-     {
-        rratio = ratio;
-     }
-
-   for (j = 0; j < vccount; j++)
-     {
-        theta = j * d;
-        sinth = sin(theta);
-        costh = cos(theta);
-        for (i = 0; i < vccount; i++)
-          {
-             fi = i * d;
-             sinfi = sin(fi);
-             cosfi = cos(fi);
-             vertices[i + j * vccount].x = (1.0 - rratio + rratio * cosfi) * 
costh * 0.5;
-             vertices[i + j * vccount].y = (1.0 - rratio + rratio * cosfi) * 
sinth * 0.5;
-             vertices[i + j * vccount].z = rratio * sinfi * 0.5;
-
-             normals[i + j * vccount].x = cosfi * costh;
-             normals[i + j * vccount].y = cosfi * sinth;
-             normals[i + j * vccount].z = sinfi;
-
-             tangents[i + j * vccount].x = -sinfi * costh;
-             tangents[i + j * vccount].y = -sinfi * sinth;
-             tangents[i + j * vccount].z = cosfi;
-
-             _vec3_normalize(&normals[i + j * vccount]);
-
-             tex_coord[i + j * vccount].x = i / (float)(vccount - 1) * 
tex_scale.x;
-             tex_coord[i + j *vccount].y = tex_scale.y - j / (float)(vccount - 
1) * tex_scale.y;
-          }
-     }
-
-   _generate_grid_indices(indices, p);
-
-   SET_VERTEX_DATA(frame)
-}
-
-void
-evas_3d_add_cylinder_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
-{
-   int vcount, icount, vccount, i;
-   icount = p * 6;
-   vccount = p + 1;
-   vcount = 2 * vccount;
-
-   ALLOCATE_VERTEX_DATA
-
-   double dfi, fi, sinfi, cosfi;
-   dfi = 2 * M_PI / p;
-
-   for (i = 0; i < vccount; i++)
-     {
-        fi = i * dfi;
-        sinfi = sin(fi);
-        cosfi = cos(fi);
-        vertices[i + vccount].x = vertices[i].x = sinfi / 2.0;
-        vertices[i + vccount].y = vertices[i].y = cosfi / 2.0;
-        vertices[i].z = -0.5;
-        vertices[i + vccount].z = 0.5;
-
-        normals[i + vccount].x = normals[i].x = sinfi;
-        normals[i + vccount].y = normals[i].y = cosfi;
-        normals[i + vccount].z = normals[i].z = 0;
-
-        tangents[i + vccount].x = tangents[i].x = cosfi;
-        tangents[i + vccount].y = tangents[i].y = -sinfi;
-        tangents[i + vccount].z = tangents[i].z = 0;
-
-        tex_coord[i].x = i / (float)(vccount - 1) * tex_scale.x;
-        tex_coord[i].y = 0;
-        tex_coord[i + vccount].x = i / (float)(vccount - 1) * tex_scale.x;
-        tex_coord[i + vccount].y = tex_scale.y;
-     }
-
-   _generate_tape_indices(indices, p);
-
-   SET_VERTEX_DATA(frame)
-}
-
-void
-evas_3d_add_cone_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
-{
-   int vcount, icount, vccount, i;
-   double dfi, fi, sinfi, cosfi, nplane, nz;
-
-   icount = p * 6;
-   vccount = p + 1;
-   vcount = 2 * vccount;
-
-   dfi = 2.0 * M_PI / p;
-   nz = sqrt(1.0 / 3.0);
-   nplane = sqrt(2.0 / 3.0);
-
-   ALLOCATE_VERTEX_DATA
-
-   for (i = 0; i < vccount; i++)
-     {
-        fi = i * dfi;
-        sinfi = sin(fi);
-        cosfi = cos(fi);
-        vertices[i].x = sinfi / 2.0;
-        vertices[i].y = cosfi / 2.0;
-        vertices[i].z = -0.5;
-        vertices[i + vccount].x = 0;
-        vertices[i + vccount].y = 0;
-        vertices[i + vccount].z = 0.5;
-
-        normals[i + vccount].x = normals[i].x = sinfi * nplane;
-        normals[i + vccount].y = normals[i].y = cosfi * nplane;
-        normals[i + vccount].z = normals[i].z = nz;
-
-        tangents[i + vccount].x = tangents[i].x = cosfi;
-        tangents[i + vccount].y = tangents[i].y = -sinfi;
-        tangents[i + vccount].z = tangents[i].z = 0;
-
-        tex_coord[i].x = i / (float)(vccount - 1) * tex_scale.x;
-        tex_coord[i].y = 0;
-        tex_coord[i + vccount].x = tex_coord[i].x;
-        tex_coord[i + vccount].y = tex_scale.y;
-     }
-
-   _generate_tape_indices(indices, p);
-
-   SET_VERTEX_DATA(frame)
-}
-
-void
-evas_3d_add_square_frame(Eo *mesh, int frame)
-{
-   SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, square_vertices, 4, square_indices, 
6)
-}
-
-void
-evas_3d_add_cube_frame(Eo *mesh, int frame)
-{
-   SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, cube_vertices, 24, cube_indices, 36)
-}
diff --git a/src/examples/evas/evas-3d-primitives.h 
b/src/examples/evas/evas-3d-primitives.h
deleted file mode 100644
index c08ae65..0000000
--- a/src/examples/evas/evas-3d-primitives.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#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
diff --git a/src/examples/evas/evas-3d-proxy.c 
b/src/examples/evas/evas-3d-proxy.c
index b0692f2..e74670e 100644
--- a/src/examples/evas/evas-3d-proxy.c
+++ b/src/examples/evas/evas-3d-proxy.c
@@ -4,7 +4,7 @@
  * Data which will be used as texture can be generated directly in application.
  *
  * @verbatim
- * gcc -o evas-3d-proxy evas-3d-proxy.c evas-3d-primitives.c `pkg-config 
--libs --cflags efl evas ecore ecore-evas eo` -lm
+ * gcc -o evas-3d-proxy evas-3d-proxy.c `pkg-config --libs --cflags efl evas 
ecore ecore-evas eo` -lm
  * @endverbatim
  */
 
@@ -15,7 +15,6 @@
 #include <Ecore.h>
 #include <Ecore_Evas.h>
 #include <Evas.h>
-#include "evas-3d-primitives.h"
 
 #define  WIDTH          400
 #define  HEIGHT         400
@@ -33,6 +32,7 @@ typedef struct _Scene_Data
 
    Eo *camera;
    Eo *light;
+   Eo *cube;
    Eo *mesh;
    Eo *material;
    Eo *texture;
@@ -159,10 +159,15 @@ _mesh_setup(Scene_Data *data)
 
          evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, 
data->texture));
 
+   /* Set data of primitive */
+   data->cube = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cube,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    /* Setup mesh. */
    data->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(data->mesh, 0);
    eo_do(data->mesh,
+         evas_3d_mesh_from_primitive_set(0, data->cube),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_FLAT),
          evas_3d_mesh_frame_material_set(0, data->material));
 
diff --git a/src/examples/evas/evas-3d-shadows.c 
b/src/examples/evas/evas-3d-shadows.c
index 1ae4ee5..bf2319f 100644
--- a/src/examples/evas/evas-3d-shadows.c
+++ b/src/examples/evas/evas-3d-shadows.c
@@ -8,7 +8,7 @@
  * @see evas_3d_billboard_set/get
  *
  * @verbatim
- * gcc -o evas-3d-shadows evas-3d-shadows.c evas-3d-primitives.c `pkg-config 
--libs --cflags efl evas ecore ecore-evas eo eina` -lm
+ * gcc -o evas-3d-shadows evas-3d-shadows.c `pkg-config --libs --cflags efl 
evas ecore ecore-evas eo eina` -lm
  * @endverbatim
  */
 
@@ -26,7 +26,6 @@
 #include <Ecore_Evas.h>
 #include <Eina.h>
 #include <math.h>
-#include "evas-3d-primitives.h"
 #include "evas-common.h"
 
 #define  WIDTH 1024
@@ -41,8 +40,6 @@
 static const char *model_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER 
"/sonic.md2";
 static const char *image_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER 
"/sonic.png";
 static const char *b_image_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER 
"/billboard.png";
-static const vec2 tex_scale = {1, 1};
-static const vec2 fence_tex_scale = {160, 12};
 
 Ecore_Evas *ecore_evas = NULL;
 Evas *evas = NULL;
@@ -52,6 +49,7 @@ Evas_3D_Node *choosed_node = NULL;
 
 typedef struct _Body_3D
 {
+   Eo     *primitive;
    Eo     *material;
    Eo     *mesh;
    Eo     *node;
@@ -201,22 +199,35 @@ _body_material_set(Body_3D *body, float r, float g, float 
b)
 static void
 _sphere_setup(Body_3D *sphere)
 {
+   sphere->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(sphere->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SPHERE),
+         evas_3d_primitive_precision_set(50));
+
    sphere->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_sphere_frame(sphere->mesh, 0, 50, tex_scale);
+   eo_do(sphere->mesh,
+         evas_3d_mesh_from_primitive_set(0, sphere->primitive));
+
    _body_material_set(sphere, 1, 0.0, 0.0);
 
-   sphere->node =
-      eo_add(EVAS_3D_NODE_CLASS, evas,
-                    evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH),
-                    evas_3d_node_position_set(3.0, 3.0, 0.0));
+   sphere->node = eo_add(EVAS_3D_NODE_CLASS, evas,
+                         evas_3d_node_constructor(EVAS_3D_NODE_TYPE_MESH),
+                         evas_3d_node_position_set(3.0, 3.0, 0.0));
    eo_do(sphere->node, evas_3d_node_mesh_add(sphere->mesh));
 }
 
 static void
 _cone_setup(Body_3D *cone)
 {
+   cone->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(cone->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CONE),
+         evas_3d_primitive_precision_set(50));
+
    cone->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cone_frame(cone->mesh, 0, 100, tex_scale);
+   eo_do(cone->mesh,
+         evas_3d_mesh_from_primitive_set(0, cone->primitive));
+
    _body_material_set(cone, 0.8, 0.5, 0.5);
 
    cone->node =
@@ -230,8 +241,15 @@ _cone_setup(Body_3D *cone)
 static void
 _cylinder_setup(Body_3D *cylinder)
 {
+   cylinder->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(cylinder->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CYLINDER),
+         evas_3d_primitive_precision_set(50));
+
    cylinder->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cylinder_frame(cylinder->mesh, 0, 50, tex_scale);
+   eo_do(cylinder->mesh,
+         evas_3d_mesh_from_primitive_set(0, cylinder->primitive));
+
    _body_material_set(cylinder, 0.0, 0.0, 1.0);
 
    cylinder->node =
@@ -276,8 +294,17 @@ _fence_setup(Body_3D *fence)
          evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 
1.0),
          evas_3d_material_shininess_set(100.0));
+
+   fence->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(fence->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CYLINDER),
+         evas_3d_primitive_mode_set(EVAS_3D_PRIMITIVE_MODE_WITHOUT_BASE),
+         evas_3d_primitive_tex_scale_set(160.0, 12.0),
+         evas_3d_primitive_precision_set(50));
+
    fence->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cylinder_frame(fence->mesh, 0, 50, fence_tex_scale);
+   eo_do(fence->mesh,
+         evas_3d_mesh_from_primitive_set(0, fence->primitive));
 
    eo_do(fence->mesh,
          evas_3d_mesh_frame_material_set(0, fence->material),
@@ -296,8 +323,13 @@ _fence_setup(Body_3D *fence)
 static void
 _square_setup(Body_3D *square)
 {
+   square->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(square->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SQUARE));
+
    square->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_square_frame(square->mesh, 0);
+   eo_do(square->mesh,
+         evas_3d_mesh_from_primitive_set(0, square->primitive));
 
    _body_material_set(square, 0.4, 0.4, 0.4);
 
@@ -313,8 +345,13 @@ _square_setup(Body_3D *square)
 static void
 _box_setup(Body_3D *box)
 {
+   box->primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(box->primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CUBE));
+
    box->mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_cube_frame(box->mesh, 0);
+   eo_do(box->mesh,
+         evas_3d_mesh_from_primitive_set(0, box->primitive));
 
    _body_material_set(box, 0, 1, 0);
 
@@ -370,8 +407,13 @@ _billboard_setup(Scene_Data *data)
          evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT,
                                   EVAS_3D_WRAP_MODE_REPEAT));
 
+   data->billboard.primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->billboard.primitive,
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_SQUARE));
+
    data->billboard.mesh = eo_add(EVAS_3D_MESH_CLASS, evas);
-   evas_3d_add_square_frame(data->billboard.mesh, 0);
+   eo_do(data->billboard.mesh,
+         evas_3d_mesh_from_primitive_set(0, data->billboard.primitive));
 
    _body_material_set(&(data->billboard), 1.0, 1.0, 1.0);
 
diff --git a/src/examples/evas/shooter/evas-3d-shooter-header.h 
b/src/examples/evas/shooter/evas-3d-shooter-header.h
index 2910c07..67b912e 100644
--- a/src/examples/evas/shooter/evas-3d-shooter-header.h
+++ b/src/examples/evas/shooter/evas-3d-shooter-header.h
@@ -14,7 +14,6 @@
 #include <Evas.h>
 #include "Eo.h"
 #include "evas-3d-shooter-macros.h"
-#include "../evas-3d-primitives.h"
 #include "../evas-common.h"
 
 #define LOCAL_IMAGE_FOLDER PACKAGE_EXAMPLES_DIR "" EVAS_PROJECT_IMAGE_FOLDER
@@ -22,6 +21,7 @@
 
 typedef struct _Scene_Data
 {
+   Eo      *cylinder_primitive;
    Eo      *texture_diffuse_eagle;
    Eo      *texture_diffuse_world;
    Eo      *texture_diffuse_grass;
diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h 
b/src/examples/evas/shooter/evas-3d-shooter-macros.h
index 83c4710..915afeb 100644
--- a/src/examples/evas/shooter/evas-3d-shooter-macros.h
+++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h
@@ -49,6 +49,18 @@
 #define  SNAKE_FRAME_Z1   -59
 #define  SNAKE_FRAME_Z2   32
 
+typedef struct _vec3
+{
+    float   x;
+    float   y;
+    float   z;
+} vec3;
+
+typedef struct _vec2
+{
+    float   x;
+    float   y;
+} vec2;
 
 #define KEY_MOTION(lateral, camera)               \
    {                                              \
diff --git a/src/examples/evas/shooter/evas-3d-shooter.c 
b/src/examples/evas/shooter/evas-3d-shooter.c
index 0ca334b..a7caef1 100644
--- a/src/examples/evas/shooter/evas-3d-shooter.c
+++ b/src/examples/evas/shooter/evas-3d-shooter.c
@@ -9,7 +9,7 @@
 * which fixes the rocket entry. The warrior isn't passable for camera,
 * neither is wall, stairs and columns. There is a possibility to go upstairs 
and break down.
 *
-* Compile with "gcc -g evas-3d-shooter.c evas-3d-shooter-header.c 
../evas-3d-primitives.c -o evas-3d-shooter `pkg-config --libs --cflags efl evas 
ecore ecore-evas eo` -lm"
+* Compile with "gcc -g evas-3d-shooter.c evas-3d-shooter-header.c -o 
evas-3d-shooter `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm"
 *
 * Run program with flag "-s=TRUE" to turn on shadows, with "-f=TRUE" to turn 
on the fog, with "-b=TRUE" to turn on the blending.
 */
@@ -1008,9 +1008,6 @@ _mesh_setup_gun_planet(Scene_Data *data)
    MATERIAL_TEXTURE_SET(carpet, carpet, gazebo_top_path, gazebo_t_path)
    NORMAL_SET(carpet, carpet, gazebo_t_n_path)
 
-
-
-
    if (data->blending)
      {
         eo_do(data->texture_diffuse_carpet,
@@ -1138,9 +1135,8 @@ _mesh_setup_column(Scene_Data *data, int index)
 
    SETUP_MESH_NODE(column[index])
 
-   evas_3d_add_cylinder_frame(data->mesh_column[index], 0, 50, tex_scale);
-
    eo_do(data->mesh_column[index],
+         evas_3d_mesh_from_primitive_set(0, data->cylinder_primitive),
          evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE),
          evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES),
          evas_3d_mesh_frame_material_set(0, data->material_column),
@@ -1273,9 +1269,17 @@ _scene_setup(Scene_Data *data)
    _light_setup(data);
    _mesh_setup_gun_planet(data);
    _mesh_setup_snake(data);
+
    for (i = 0; i < 10; i++)
      _mesh_setup_rocket(data, i);
 
+   data->cylinder_primitive = eo_add(EVAS_3D_PRIMITIVE_CLASS, evas);
+   eo_do(data->cylinder_primitive,
+         evas_3d_primitive_mode_set(EVAS_3D_PRIMITIVE_MODE_WITHOUT_BASE),
+         evas_3d_primitive_form_set(EVAS_3D_MESH_PRIMITIVE_CYLINDER),
+         evas_3d_primitive_tex_scale_set(1.0, 1.0),
+         evas_3d_primitive_precision_set(50));
+
    for ( i = 0; i < 4; i++)
      _mesh_setup_column(data, i);
 

-- 


Reply via email to