summaryrefslogtreecommitdiff
path: root/src/modules/evas/model_savers
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2015-07-14 11:19:35 +0100
committerTom Hacohen <tom@stosb.com>2015-08-04 10:57:14 +0100
commit60b16be772bfa5d799dd405deb66c4dd85bd76ab (patch)
tree8078c46a13f94befeb29f2a4b94f10033420682c /src/modules/evas/model_savers
parent086a501be6d5f25c4e91d3de143984d78b4b83a0 (diff)
Evas canvas3d: Move evas 3d types to evas_types.eot
Summary: Move evas_canvas3d types from Evas_Eo.h to evas_types.eot Change enum constatnt for vertex_arrtib, material_attrib, blend_func Correct namespace for Evas.Real type Reviewers: cedric, tasn Reviewed By: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2734
Diffstat (limited to 'src/modules/evas/model_savers')
-rw-r--r--src/modules/evas/model_savers/eet/evas_model_save_eet.c6
-rw-r--r--src/modules/evas/model_savers/obj/evas_model_save_obj.c30
-rw-r--r--src/modules/evas/model_savers/ply/evas_model_save_ply.c8
3 files changed, 22 insertions, 22 deletions
diff --git a/src/modules/evas/model_savers/eet/evas_model_save_eet.c b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
index 71e094ad1d..ff43a3f851 100644
--- a/src/modules/evas/model_savers/eet/evas_model_save_eet.c
+++ b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
@@ -59,9 +59,9 @@ _set_geometry_to_eet_file_from_mesh(Evas_Canvas3D_Mesh_Data *mesh,
59 src += f->vertices[a].element_count;\ 59 src += f->vertices[a].element_count;\
60 } 60 }
61 geometry->vertices = vertices; 61 geometry->vertices = vertices;
62 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_POSITION, position, vertices[i].position.z = src[2];) 62 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, position, vertices[i].position.z = src[2];)
63 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_NORMAL, normal, vertices[i].normal.z = src[2];) 63 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, normal, vertices[i].normal.z = src[2];)
64 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_TEXCOORD, texcoord,) 64 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, texcoord,)
65#undef SAVE_GEOMETRICS 65#undef SAVE_GEOMETRICS
66 66
67 eet_mesh->geometries = geometry; 67 eet_mesh->geometries = geometry;
diff --git a/src/modules/evas/model_savers/obj/evas_model_save_obj.c b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
index b009c32b6c..d9be3dce44 100644
--- a/src/modules/evas/model_savers/obj/evas_model_save_obj.c
+++ b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
@@ -20,7 +20,7 @@
20 for (i = 0; i < pd->vertex_count; i++) \ 20 for (i = 0; i < pd->vertex_count; i++) \
21 { \ 21 { \
22 fprintf(_obj_file, format, src[0], src[1]); \ 22 fprintf(_obj_file, format, src[0], src[1]); \
23 if (a != EVAS_CANVAS3D_VERTEX_TEXCOORD) \ 23 if (a != EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD) \
24 fprintf(_obj_file, " %.4f", src[2]); \ 24 fprintf(_obj_file, " %.4f", src[2]); \
25 fprintf(_obj_file, "\n"); \ 25 fprintf(_obj_file, "\n"); \
26 src += f->vertices[a].element_count; \ 26 src += f->vertices[a].element_count; \
@@ -103,12 +103,12 @@ _save_mesh(Evas_Canvas3D_Mesh_Data *pd, const char *_obj_file_name, Evas_Canvas3
103 return; 103 return;
104 } 104 }
105 105
106 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_POSITION, "v %.4f %.4f") 106 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, "v %.4f %.4f")
107 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_NORMAL, "vn %.4f %.4f") 107 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, "vn %.4f %.4f")
108 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_TEXCOORD, "vt %.4f %.4f") 108 SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, "vt %.4f %.4f")
109 109
110 existence_of_normal = (f->vertices[EVAS_CANVAS3D_VERTEX_NORMAL].data != NULL); 110 existence_of_normal = (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL].data != NULL);
111 existence_of_tex_point = (f->vertices[EVAS_CANVAS3D_VERTEX_TEXCOORD].data != NULL); 111 existence_of_tex_point = (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD].data != NULL);
112 112
113 fprintf(_obj_file,"usemtl Material\n s off\n"); 113 fprintf(_obj_file,"usemtl Material\n s off\n");
114 for (i = 1; i <= pd->vertex_count; i++)//numeration of faces in .obj started from 1 114 for (i = 1; i <= pd->vertex_count; i++)//numeration of faces in .obj started from 1
@@ -138,17 +138,17 @@ _save_material(Evas_Canvas3D_Mesh_Data *pd EINA_UNUSED,
138 fprintf(_mtl_file, "newmtl Material \n"); 138 fprintf(_mtl_file, "newmtl Material \n");
139 fprintf(_mtl_file, "Ns 1.000000 \n");//exp factor for specular highlight 139 fprintf(_mtl_file, "Ns 1.000000 \n");//exp factor for specular highlight
140 fprintf(_mtl_file, "Ka %.6f %.6f %.6f \n", 140 fprintf(_mtl_file, "Ka %.6f %.6f %.6f \n",
141 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.r, 141 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.r,
142 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.g, 142 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.g,
143 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.b); 143 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.b);
144 fprintf(_mtl_file, "Kd %.6f %.6f %.6f \n", 144 fprintf(_mtl_file, "Kd %.6f %.6f %.6f \n",
145 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.r, 145 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.r,
146 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.g, 146 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.g,
147 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.b); 147 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.b);
148 fprintf(_mtl_file, "Ks %.6f %.6f %.6f \n", 148 fprintf(_mtl_file, "Ks %.6f %.6f %.6f \n",
149 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.r, 149 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.r,
150 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.g, 150 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.g,
151 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.b); 151 (float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.b);
152 fprintf(_mtl_file, "Ni 1.000000 \n");//optical density 152 fprintf(_mtl_file, "Ni 1.000000 \n");//optical density
153 fprintf(_mtl_file, "d 1.000000 \n");//a factor d of 1.0 is fully opaque material 153 fprintf(_mtl_file, "d 1.000000 \n");//a factor d of 1.0 is fully opaque material
154 fprintf(_mtl_file, "illum 2 \n");//illumination properties 154 fprintf(_mtl_file, "illum 2 \n");//illumination properties
diff --git a/src/modules/evas/model_savers/ply/evas_model_save_ply.c b/src/modules/evas/model_savers/ply/evas_model_save_ply.c
index e5ad7c2b68..05eeca6331 100644
--- a/src/modules/evas/model_savers/ply/evas_model_save_ply.c
+++ b/src/modules/evas/model_savers/ply/evas_model_save_ply.c
@@ -33,10 +33,10 @@ evas_model_save_file_ply(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_
33 fprintf(_ply_file,"element face %d\nproperty list uchar uint vertex_indices\nend_header\n", 33 fprintf(_ply_file,"element face %d\nproperty list uchar uint vertex_indices\nend_header\n",
34 pd->vertex_count / 3); 34 pd->vertex_count / 3);
35 35
36 src_pos = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_POSITION])->data; 36 src_pos = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION])->data;
37 src_nor = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_NORMAL])->data; 37 src_nor = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL])->data;
38 src_tex = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_TEXCOORD])->data; 38 src_tex = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD])->data;
39 src_col = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_COLOR])->data; 39 src_col = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR])->data;
40 40
41 for (i = 0; i < pd->vertex_count; i++) 41 for (i = 0; i < pd->vertex_count; i++)
42 { 42 {