summaryrefslogtreecommitdiff
path: root/src/examples/evas
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/evas')
-rw-r--r--src/examples/evas/evas-3d-aabb.c157
-rw-r--r--src/examples/evas/evas-3d-blending.c128
-rw-r--r--src/examples/evas/evas-3d-colorpick.c156
-rw-r--r--src/examples/evas/evas-3d-cube-rotate.c91
-rw-r--r--src/examples/evas/evas-3d-cube.c123
-rw-r--r--src/examples/evas/evas-3d-cube2.c150
-rw-r--r--src/examples/evas/evas-3d-eet.c136
-rw-r--r--src/examples/evas/evas-3d-fog.c127
-rw-r--r--src/examples/evas/evas-3d-frustum.c229
-rw-r--r--src/examples/evas/evas-3d-hull.c242
-rw-r--r--src/examples/evas/evas-3d-md2.c120
-rw-r--r--src/examples/evas/evas-3d-mmap-set.c137
-rw-r--r--src/examples/evas/evas-3d-obj.c129
-rw-r--r--src/examples/evas/evas-3d-parallax-occlusion.c186
-rw-r--r--src/examples/evas/evas-3d-pick.c97
-rw-r--r--src/examples/evas/evas-3d-ply.c132
-rw-r--r--src/examples/evas/evas-3d-proxy.c131
-rw-r--r--src/examples/evas/evas-3d-shadows.c470
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c75
-rw-r--r--src/examples/evas/evas-vg-simple.c46
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-header.c95
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter-macros.h109
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter.c527
23 files changed, 1558 insertions, 2235 deletions
diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c
index c8d906c..d02668b 100644
--- a/src/examples/evas/evas-3d-aabb.c
+++ b/src/examples/evas/evas-3d-aabb.c
@@ -57,7 +57,7 @@ _animate_scene(void *data)
57{ 57{
58 static int frame = 0; 58 static int frame = 0;
59 59
60 eo_do((Evas_Canvas3D_Node *)data, evas_canvas3d_node_mesh_frame_set(mesh, frame)); 60 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh, frame);
61 61
62 _redraw_aabb(); 62 _redraw_aabb();
63 63
@@ -84,22 +84,22 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
84 { 84 {
85 case 1: 85 case 1:
86 { 86 {
87 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 1.0, 0.0, 0.0)); 87 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 1.0, 0.0, 0.0);
88 break; 88 break;
89 } 89 }
90 case 2: 90 case 2:
91 { 91 {
92 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 0.0, 1.0, 0.0)); 92 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 0.0, 1.0, 0.0);
93 break; 93 break;
94 } 94 }
95 case 3: 95 case 3:
96 { 96 {
97 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 0.0, 0.0, 1.0)); 97 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 0.0, 0.0, 1.0);
98 break; 98 break;
99 } 99 }
100 case 4: 100 case 4:
101 { 101 {
102 eo_do(node, evas_canvas3d_node_orientation_angle_axis_set(90, 1.0, 1.0, 0.0)); 102 evas_canvas3d_node_orientation_angle_axis_set(node, 90, 1.0, 1.0, 0.0);
103 break; 103 break;
104 } 104 }
105 } 105 }
@@ -111,8 +111,8 @@ _on_canvas_resize(Ecore_Evas *ee)
111 int w, h; 111 int w, h;
112 112
113 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 113 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
114 eo_do(background, efl_gfx_size_set(w, h)); 114 efl_gfx_size_set(background, w, h);
115 eo_do(image, efl_gfx_size_set(w, h)); 115 efl_gfx_size_set(image, w, h);
116} 116}
117 117
118static Eina_Bool 118static Eina_Bool
@@ -120,9 +120,9 @@ _redraw_aabb()
120{ 120{
121 Evas_Real x0, y0, z0, x1, y1, z1; 121 Evas_Real x0, y0, z0, x1, y1, z1;
122 122
123 eo_do(mesh_node, evas_canvas3d_node_bounding_box_get(&x0, &y0, &z0, &x1, &y1, &z1)); 123 evas_canvas3d_node_bounding_box_get(mesh_node, &x0, &y0, &z0, &x1, &y1, &z1);
124 eo_do(mesh_box_node, evas_canvas3d_node_position_set((x0 + x1)/2, (y0 + y1)/2, (z0 + z1)/2), 124 evas_canvas3d_node_position_set(mesh_box_node, (x0 + x1)/2, (y0 + y1)/2, (z0 + z1)/2);
125 evas_canvas3d_node_scale_set(x1 - x0, y1 - y0, z1 - z0)); 125 evas_canvas3d_node_scale_set(mesh_box_node, x1 - x0, y1 - y0, z1 - z0);
126 126
127 return EINA_TRUE; 127 return EINA_TRUE;
128} 128}
@@ -144,118 +144,87 @@ main(void)
144 144
145 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 145 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
146 146
147 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 147 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
148 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
149 148
150 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 149 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
151 eo_do(camera, 150 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
152 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0));
153 151
154 camera_node = 152 camera_node =
155 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 153 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
156 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 154 evas_canvas3d_node_camera_set(camera_node, camera);
157 eo_do(camera_node, 155 evas_canvas3d_node_member_add(root_node, camera_node);
158 evas_canvas3d_node_camera_set(camera)); 156 evas_canvas3d_node_position_set(camera_node, 100.0, 50.0, 20.0);
159 eo_do(root_node, 157 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
160 evas_canvas3d_node_member_add(camera_node));
161 eo_do(camera_node,
162 evas_canvas3d_node_position_set(100.0, 50.0, 20.0),
163 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0,
164 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
165 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 158 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
166 eo_do(light, 159 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
167 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 160 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
168 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 161 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
169 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 162 evas_canvas3d_light_directional_set(light, EINA_TRUE);
170 evas_canvas3d_light_directional_set(EINA_TRUE));
171 163
172 light_node = 164 light_node =
173 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 165 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 166 evas_canvas3d_node_light_set(light_node, light);
175 eo_do(light_node, 167 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
176 evas_canvas3d_node_light_set(light), 168 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
177 evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0), 169 evas_canvas3d_node_member_add(root_node, light_node);
178 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
179 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
180 eo_do(root_node,
181 evas_canvas3d_node_member_add(light_node));
182 170
183 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 171 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
184 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 172 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
185 173
186 eo_do(mesh, 174 efl_file_set(mesh, model_path, NULL);
187 efl_file_set(model_path, NULL), 175 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
188 evas_canvas3d_mesh_frame_material_set(0, material), 176 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
189 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
190 177
191 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 178 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
192 eo_do(texture, 179 evas_canvas3d_texture_file_set(texture, image_path, NULL);
193 evas_canvas3d_texture_file_set(image_path, NULL), 180 evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
194 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 181 evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
195 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 182 evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture);
196 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 183 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
197 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 184 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
198 eo_do(material, 185 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
199 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture), 186 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
200 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 187 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
201 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 188 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
202 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 189 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
203 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 190 evas_canvas3d_material_shininess_set(material, 50.0);
204 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 191
205 0.01, 0.01, 0.01, 1.0), 192 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
206 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 193 mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
207 1.0, 1.0, 1.0, 1.0),
208 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
209 1.0, 1.0, 1.0, 1.0),
210 evas_canvas3d_material_shininess_set(50.0));
211
212 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
213 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
214 mesh_box_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
215 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
216 194
217 material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 195 material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
218 eo_do(material_box, evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE)); 196 evas_canvas3d_material_enable_set(material_box, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
219 197
220 cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 198 cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
221 eo_do(cube, 199 evas_canvas3d_primitive_form_set(cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
222 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
223 200
224 mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 201 mesh_box = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
225 eo_do(mesh_box, 202 evas_canvas3d_mesh_from_primitive_set(mesh_box, 0, cube);
226 evas_canvas3d_mesh_from_primitive_set(0, cube), 203 evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
227 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES), 204 evas_canvas3d_mesh_shade_mode_set(mesh_box, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR);
228 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR), 205 evas_canvas3d_mesh_frame_material_set(mesh_box, 0, material_box);
229 evas_canvas3d_mesh_frame_material_set(0, material_box));
230 _redraw_aabb(); 206 _redraw_aabb();
231 207
232 eo_do(root_node, 208 evas_canvas3d_node_member_add(root_node, mesh_box_node);
233 evas_canvas3d_node_member_add(mesh_box_node)); 209 evas_canvas3d_node_mesh_add(mesh_box_node, mesh_box);
234 eo_do(mesh_box_node,
235 evas_canvas3d_node_mesh_add(mesh_box));
236 210
237 eo_do(root_node, 211 evas_canvas3d_node_member_add(root_node, mesh_node);
238 evas_canvas3d_node_member_add(mesh_node)); 212 evas_canvas3d_node_mesh_add(mesh_node, mesh);
239 eo_do(mesh_node,
240 evas_canvas3d_node_mesh_add(mesh));
241 213
242 eo_do(scene, 214 evas_canvas3d_scene_root_node_set(scene, root_node);
243 evas_canvas3d_scene_root_node_set(root_node), 215 evas_canvas3d_scene_camera_node_set(scene, camera_node);
244 evas_canvas3d_scene_camera_node_set(camera_node), 216 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
245 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
246 217
247 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 218 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
248 eo_do(background, 219 efl_gfx_color_set(background, 0, 0, 0, 255);
249 efl_gfx_color_set(0, 0, 0, 255), 220 efl_gfx_size_set(background, WIDTH, HEIGHT);
250 efl_gfx_size_set(WIDTH, HEIGHT), 221 efl_gfx_visible_set(background, EINA_TRUE);
251 efl_gfx_visible_set(EINA_TRUE));
252 222
253 image = evas_object_image_filled_add(evas); 223 image = evas_object_image_filled_add(evas);
254 eo_do(image, 224 efl_gfx_size_set(image, WIDTH, HEIGHT);
255 efl_gfx_size_set(WIDTH, HEIGHT), 225 efl_gfx_visible_set(image, EINA_TRUE);
256 efl_gfx_visible_set(EINA_TRUE));
257 evas_object_focus_set(image, EINA_TRUE); 226 evas_object_focus_set(image, EINA_TRUE);
258 eo_do(image, evas_obj_image_scene_set(scene)); 227 evas_obj_image_scene_set(image, scene);
259 228
260 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _on_key_down, mesh_node); 229 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _on_key_down, mesh_node);
261 230
diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c
index 98bd74a..db7c7a1 100644
--- a/src/examples/evas/evas-3d-blending.c
+++ b/src/examples/evas/evas-3d-blending.c
@@ -102,7 +102,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
102 func2 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE; 102 func2 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE;
103 if(func2 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE) 103 if(func2 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE)
104 func2 = EVAS_CANVAS3D_BLEND_FUNC_ZERO; 104 func2 = EVAS_CANVAS3D_BLEND_FUNC_ZERO;
105 eo_do(scene->mesh1, evas_canvas3d_mesh_blending_func_set(func1, func2)); 105 evas_canvas3d_mesh_blending_func_set(scene->mesh1, func1, func2);
106 printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]); 106 printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]);
107} 107}
108 108
@@ -121,8 +121,8 @@ _on_canvas_resize(Ecore_Evas *ee)
121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
122 122
123 evas_object_resize(background, w, h); 123 evas_object_resize(background, w, h);
124 eo_do(background, efl_gfx_size_set(w, h)); 124 efl_gfx_size_set(background, w, h);
125 eo_do(image, efl_gfx_size_set(w, h)); 125 efl_gfx_size_set(image, w, h);
126} 126}
127 127
128static Eina_Bool 128static Eina_Bool
@@ -133,8 +133,7 @@ _animate_scene(void *data)
133 133
134 angle += 0.02; 134 angle += 0.02;
135 135
136 eo_do(scene->mesh_node, 136 evas_canvas3d_node_position_set(scene->mesh_node, 3 * sin(angle), 0.0, 3 * cos(angle));
137 evas_canvas3d_node_position_set(3 * sin(angle), 0.0, 3 * cos(angle)));
138 137
139 if (angle > 2 * M_PI) angle = 0; 138 if (angle > 2 * M_PI) angle = 0;
140 139
@@ -146,49 +145,40 @@ _camera_setup(Scene_Data *data)
146{ 145{
147 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 146 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
148 147
149 eo_do(data->camera, 148 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
150 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
151 149
152 data->camera_node = 150 data->camera_node =
153 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 151 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
154 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
155 152
156 eo_do(data->camera_node, 153 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
157 evas_canvas3d_node_camera_set(data->camera), 154 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
158 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 155 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
159 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
160 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
161 156
162 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 157 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
163} 158}
164 159
165static void 160static void
166_light_setup(Scene_Data *data) 161_light_setup(Scene_Data *data)
167{ 162{
168 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 163 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
169 eo_do(data->light, 164 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
170 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 165 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
171 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 166 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
172 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
173 167
174 data->light_node = 168 data->light_node =
175 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 169 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
176 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 170 evas_canvas3d_node_light_set(data->light_node, data->light);
177 eo_do(data->light_node, 171 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
178 evas_canvas3d_node_light_set(data->light), 172 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
179 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 173 evas_canvas3d_node_member_add(data->root_node, data->light_node);
180 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
181 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
182 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
183} 174}
184 175
185static void 176static void
186_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) 177_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material)
187{ 178{
188 eo_do(mesh, 179 evas_canvas3d_mesh_from_primitive_set(mesh, 0, sphere);
189 evas_canvas3d_mesh_from_primitive_set(0, sphere), 180 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
190 evas_canvas3d_mesh_frame_material_set(0, material), 181 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
191 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
192} 182}
193 183
194static void 184static void
@@ -196,32 +186,27 @@ _mesh_setup(Scene_Data *data)
196{ 186{
197 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 187 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
198 188
199 eo_do(data->material, 189 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
200 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 190 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
201 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 191 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
202 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 192 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 0.2, 0.2, 0.2);
203 193 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 0.0, 0.0, 0.2);
204 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 0.2, 0.2, 0.2), 194 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2);
205 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 0.0, 0.0, 0.2), 195 evas_canvas3d_material_shininess_set(data->material, 100.0);
206 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
207 evas_canvas3d_material_shininess_set(100.0));
208 196
209 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 197 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
210 198
211 eo_do(data->material1, 199 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
212 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 200 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
213 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 201 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
214 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 202 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.0, 0.2, 0.2, 0.2);
215 203 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 0.0, 1.0, 0.2);
216 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.0, 0.2, 0.2, 0.2), 204 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2);
217 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 0.0, 1.0, 0.2), 205 evas_canvas3d_material_shininess_set(data->material1, 100.0);
218 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
219 evas_canvas3d_material_shininess_set(100.0));
220 206
221 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 207 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
222 eo_do(data->sphere, 208 evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
223 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 209 evas_canvas3d_primitive_precision_set(data->sphere, 50);
224 evas_canvas3d_primitive_precision_set(50));
225 210
226 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 211 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
227 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 212 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
@@ -230,27 +215,23 @@ _mesh_setup(Scene_Data *data)
230 _set_ball(data->mesh1, data->sphere, data->material1); 215 _set_ball(data->mesh1, data->sphere, data->material1);
231 216
232 data->mesh_node = 217 data->mesh_node =
233 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 218 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
234 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
235 219
236 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 220 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
237 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh)); 221 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
238 222
239 data->mesh_node1 = 223 data->mesh_node1 =
240 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 224 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
241 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
242 225
243 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1)); 226 evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
244 eo_do(data->mesh_node1, evas_canvas3d_node_mesh_add(data->mesh1)); 227 evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
245 228
246 eo_do(data->mesh1, evas_canvas3d_mesh_blending_enable_set(EINA_TRUE), 229 evas_canvas3d_mesh_blending_enable_set(data->mesh1, EINA_TRUE);
247 evas_canvas3d_mesh_blending_func_set(func1, func2)); 230 evas_canvas3d_mesh_blending_func_set(data->mesh1, func1, func2);
248 231
249 eo_do(data->mesh_node, 232 evas_canvas3d_node_scale_set(data->mesh_node, 2.0, 2.0, 2.0);
250 evas_canvas3d_node_scale_set(2.0, 2.0, 2.0));
251 233
252 eo_do(data->mesh_node1, 234 evas_canvas3d_node_scale_set(data->mesh_node1, 5.0, 5.0, 5.0);
253 evas_canvas3d_node_scale_set(5.0, 5.0, 5.0));
254} 235}
255 236
256static void 237static void
@@ -258,21 +239,18 @@ _scene_setup(Scene_Data *data)
258{ 239{
259 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 240 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
260 241
261 eo_do(data->scene, 242 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
262 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 243 evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 1);
263 evas_canvas3d_scene_background_color_set(0.5, 0.5, 0.5, 1));
264 244
265 data->root_node = 245 data->root_node =
266 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 246 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
267 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
268 247
269 _camera_setup(data); 248 _camera_setup(data);
270 _light_setup(data); 249 _light_setup(data);
271 _mesh_setup(data); 250 _mesh_setup(data);
272 251
273 eo_do(data->scene, 252 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
274 evas_canvas3d_scene_root_node_set(data->root_node), 253 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
275 evas_canvas3d_scene_camera_node_set(data->camera_node));
276} 254}
277 255
278int 256int
@@ -312,7 +290,7 @@ main(void)
312 evas_object_focus_set(image, EINA_TRUE); 290 evas_object_focus_set(image, EINA_TRUE);
313 291
314 /* Set the image object as render target for 3D scene. */ 292 /* Set the image object as render target for 3D scene. */
315 eo_do(image, evas_obj_image_scene_set(data.scene)); 293 evas_obj_image_scene_set(image, data.scene);
316 294
317 295
318 /* Add animation timer callback. */ 296 /* Add animation timer callback. */
diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c
index f3cf3b4..885a53b 100644
--- a/src/examples/evas/evas-3d-colorpick.c
+++ b/src/examples/evas/evas-3d-colorpick.c
@@ -119,8 +119,8 @@ _on_canvas_resize(Ecore_Evas *ee)
119 int w, h; 119 int w, h;
120 120
121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 121 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
122 eo_do(bg, efl_gfx_size_set(w, h)); 122 efl_gfx_size_set(bg, w, h);
123 eo_do(image, efl_gfx_size_set(w, h)); 123 efl_gfx_size_set(image, w, h);
124} 124}
125 125
126static Eina_Bool 126static Eina_Bool
@@ -129,7 +129,7 @@ _animate_sphere(void *data)
129 static int angle = 0.0; 129 static int angle = 0.0;
130 Eo *n = (Eo*)(((Test_object *)data)->node); 130 Eo *n = (Eo*)(((Test_object *)data)->node);
131 Evas_Real s = ((Test_object *)data)->speed; 131 Evas_Real s = ((Test_object *)data)->speed;
132 eo_do(n, evas_canvas3d_node_orientation_angle_axis_set(angle, s, s - 1, s + 1)); 132 evas_canvas3d_node_orientation_angle_axis_set(n, angle, s, s - 1, s + 1);
133 angle++; 133 angle++;
134 if (angle > 360) angle = 0.0; 134 if (angle > 360) angle = 0.0;
135 return EINA_TRUE; 135 return EINA_TRUE;
@@ -141,9 +141,8 @@ void _recalculate_position()
141 Evas_Real x1, y1, shiftx = 0, shifty = 0; 141 Evas_Real x1, y1, shiftx = 0, shifty = 0;
142 Test_object *m; 142 Test_object *m;
143 143
144 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 144 evas_canvas3d_object_update(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node);
145 evas_canvas3d_object_update(), 145 evas_canvas3d_node_bounding_box_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, NULL, NULL, NULL, &x1, &y1, NULL);
146 evas_canvas3d_node_bounding_box_get(NULL, NULL, NULL, &x1, &y1, NULL));
147 146
148 for (i = 0; i < globalscene.row; ++i) 147 for (i = 0; i < globalscene.row; ++i)
149 { 148 {
@@ -152,7 +151,7 @@ void _recalculate_position()
152 { 151 {
153 shifty = (j * 2 - globalscene.col) * y1; 152 shifty = (j * 2 - globalscene.col) * y1;
154 m = (Test_object *)eina_list_nth(globalscene.spheres, count); 153 m = (Test_object *)eina_list_nth(globalscene.spheres, count);
155 eo_do(m->node, evas_canvas3d_node_position_set(shifty, 0.0, shiftx)); 154 evas_canvas3d_node_position_set(m->node, shifty, 0.0, shiftx);
156 count++; 155 count++;
157 } 156 }
158 } 157 }
@@ -167,31 +166,29 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
167 Test_object * item; 166 Test_object * item;
168 if (!strcmp(ev->key, "Down")) 167 if (!strcmp(ev->key, "Down"))
169 { 168 {
170 eo_do(globalscene.camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z), 169 evas_canvas3d_node_position_get(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
171 evas_canvas3d_node_position_set(x, y, (z - 5))); 170 evas_canvas3d_node_position_set(globalscene.camera_node, x, y, (z - 5));
172 } 171 }
173 else if (!strcmp(ev->key, "Up")) 172 else if (!strcmp(ev->key, "Up"))
174 { 173 {
175 eo_do(globalscene.camera_node, evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z), 174 evas_canvas3d_node_position_get(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
176 evas_canvas3d_node_position_set(x, y, (z + 5))); 175 evas_canvas3d_node_position_set(globalscene.camera_node, x, y, (z + 5));
177 } 176 }
178 else if (!strcmp(ev->key, "Left")) 177 else if (!strcmp(ev->key, "Left"))
179 { 178 {
180 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 179 evas_canvas3d_node_scale_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
181 evas_canvas3d_node_scale_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
182 EINA_LIST_FOREACH(globalscene.spheres, l, item) 180 EINA_LIST_FOREACH(globalscene.spheres, l, item)
183 { 181 {
184 eo_do(item->node, evas_canvas3d_node_scale_set((x - SCALE_UNIT), (y - SCALE_UNIT), (z - SCALE_UNIT))); 182 evas_canvas3d_node_scale_set(item->node, (x - SCALE_UNIT), (y - SCALE_UNIT), (z - SCALE_UNIT));
185 } 183 }
186 _recalculate_position(); 184 _recalculate_position();
187 } 185 }
188 else if (!strcmp(ev->key, "Right")) 186 else if (!strcmp(ev->key, "Right"))
189 { 187 {
190 eo_do(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, 188 evas_canvas3d_node_scale_get(((Test_object *)eina_list_nth(globalscene.spheres, 0))->node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
191 evas_canvas3d_node_scale_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
192 EINA_LIST_FOREACH(globalscene.spheres, l, item) 189 EINA_LIST_FOREACH(globalscene.spheres, l, item)
193 { 190 {
194 eo_do(item->node, evas_canvas3d_node_scale_set((x + SCALE_UNIT), (y + SCALE_UNIT), (z + SCALE_UNIT))); 191 evas_canvas3d_node_scale_set(item->node, (x + SCALE_UNIT), (y + SCALE_UNIT), (z + SCALE_UNIT));
195 } 192 }
196 _recalculate_position(); 193 _recalculate_position();
197 } 194 }
@@ -212,27 +209,26 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA
212 Eina_Bool flag; 209 Eina_Bool flag;
213 if (ev->button == 1) 210 if (ev->button == 1)
214 { 211 {
215 eo_do(globalscene.scene, evas_canvas3d_scene_color_pick_enable_set(EINA_TRUE)); 212 evas_canvas3d_scene_color_pick_enable_set(globalscene.scene, EINA_TRUE);
216 eo_do(globalscene.scene, 213 flag = evas_canvas3d_scene_pick(globalscene.scene, ev->canvas.x, ev->canvas.y, &n, &m, NULL, NULL);
217 flag = evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, NULL, NULL));
218 time = clock() - time; 214 time = clock() - time;
219 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10; 215 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10;
220 if (flag) 216 if (flag)
221 { 217 {
222 fprintf(stdout, "Boom! Time expended for color pick: %2.7f .\n", diff_sec); 218 fprintf(stdout, "Boom! Time expended for color pick: %2.7f .\n", diff_sec);
223 eo_do(n, evas_canvas3d_node_scale_set(VEC_3(SMALL_SCALE))); 219 evas_canvas3d_node_scale_set(n, VEC_3(SMALL_SCALE));
224 } 220 }
225 } 221 }
226 else 222 else
227 { 223 {
228 eo_do(globalscene.scene, evas_canvas3d_scene_color_pick_enable_set(EINA_FALSE)); 224 evas_canvas3d_scene_color_pick_enable_set(globalscene.scene, EINA_FALSE);
229 eo_do(globalscene.scene, flag = evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, &s, &t)); 225 flag = evas_canvas3d_scene_pick(globalscene.scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
230 time = clock() - time; 226 time = clock() - time;
231 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10; 227 diff_sec = ((float)time) / CLOCKS_PER_SEC / 10;
232 if (flag) 228 if (flag)
233 { 229 {
234 fprintf(stdout, "Boom! Time expended for geometry pick: %2.7f .\n", diff_sec); 230 fprintf(stdout, "Boom! Time expended for geometry pick: %2.7f .\n", diff_sec);
235 eo_do(n, evas_canvas3d_node_scale_set(VEC_3(BIG_SCALE))); 231 evas_canvas3d_node_scale_set(n, VEC_3(BIG_SCALE));
236 } 232 }
237 } 233 }
238} 234}
@@ -244,36 +240,27 @@ _init_sphere(void *this, const char *texture)
244 sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 240 sphere->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
245 sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 241 sphere->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
246 sphere->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 242 sphere->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
247 eo_do(sphere->primitive, 243 evas_canvas3d_primitive_form_set(sphere->primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
248 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 244 evas_canvas3d_primitive_precision_set(sphere->primitive, 50);
249 evas_canvas3d_primitive_precision_set(50)); 245 evas_canvas3d_mesh_from_primitive_set(sphere->mesh, 0, sphere->primitive);
250 eo_do(sphere->mesh, 246 evas_canvas3d_mesh_frame_material_set(sphere->mesh, 0, sphere->material);
251 evas_canvas3d_mesh_from_primitive_set(0, sphere->primitive), 247 evas_canvas3d_mesh_shade_mode_set(sphere->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
252 evas_canvas3d_mesh_frame_material_set(0, sphere->material),
253 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
254 248
255 eo_do(sphere->mesh, evas_canvas3d_mesh_color_pick_enable_set(EINA_TRUE)); 249 evas_canvas3d_mesh_color_pick_enable_set(sphere->mesh, EINA_TRUE);
256 250
257 sphere->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 251 sphere->texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
258 eo_do(sphere->texture, 252 evas_canvas3d_texture_file_set(sphere->texture, texture, NULL);
259 evas_canvas3d_texture_file_set(texture, NULL), 253 evas_canvas3d_texture_filter_set(sphere->texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
260 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 254 evas_canvas3d_texture_wrap_set(sphere->texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
261 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 255 evas_canvas3d_material_texture_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture);
262 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 256 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
263 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 257 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
264 eo_do(sphere->material, 258 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
265 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture), 259 evas_canvas3d_material_enable_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
266 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 260 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
267 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 261 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
268 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 262 evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
269 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 263 evas_canvas3d_material_shininess_set(sphere->material, 50.0);
270 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
271 0.01, 0.01, 0.01, 1.0),
272 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
273 1.0, 1.0, 1.0, 1.0),
274 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
275 1.0, 1.0, 1.0, 1.0),
276 evas_canvas3d_material_shininess_set(50.0));
277 return EINA_TRUE; 264 return EINA_TRUE;
278} 265}
279 266
@@ -287,41 +274,29 @@ _init_scene(const char *texture)
287 274
288 globalscene.scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 275 globalscene.scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
289 276
290 globalscene.root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 277 globalscene.root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
291 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
292 278
293 globalscene.camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 279 globalscene.camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
294 eo_do(globalscene.camera, 280 evas_canvas3d_camera_projection_perspective_set(globalscene.camera, 30.0, 1.0, 1.0, 1000.0);
295 evas_canvas3d_camera_projection_perspective_set(30.0, 1.0, 1.0, 1000.0));
296 281
297 globalscene.camera_node = 282 globalscene.camera_node =
298 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 283 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
299 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 284 evas_canvas3d_node_camera_set(globalscene.camera_node, globalscene.camera);
300 eo_do(globalscene.camera_node, 285 evas_canvas3d_node_member_add(globalscene.root_node, globalscene.camera_node);
301 evas_canvas3d_node_camera_set(globalscene.camera)); 286 evas_canvas3d_node_position_set(globalscene.camera_node, 0.0, 30.0, 800.0);
302 eo_do(globalscene.root_node, 287 evas_canvas3d_node_look_at_set(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -1000.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
303 evas_canvas3d_node_member_add(globalscene.camera_node));
304 eo_do(globalscene.camera_node,
305 evas_canvas3d_node_position_set(0.0, 30.0, 800.0),
306 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -1000.0,
307 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
308 globalscene.light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 288 globalscene.light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
309 eo_do(globalscene.light, 289 evas_canvas3d_light_ambient_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
310 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 290 evas_canvas3d_light_diffuse_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
311 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 291 evas_canvas3d_light_specular_set(globalscene.light, 1.0, 1.0, 1.0, 1.0);
312 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 292 evas_canvas3d_light_directional_set(globalscene.light, EINA_TRUE);
313 evas_canvas3d_light_directional_set(EINA_TRUE));
314 293
315 globalscene.light_node = 294 globalscene.light_node =
316 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 295 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
317 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 296 evas_canvas3d_node_light_set(globalscene.light_node, globalscene.light);
318 eo_do(globalscene.light_node, 297 evas_canvas3d_node_position_set(globalscene.light_node, 100.0, 50.0, 300.0);
319 evas_canvas3d_node_light_set(globalscene.light), 298 evas_canvas3d_node_look_at_set(globalscene.light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0);
320 evas_canvas3d_node_position_set(100.0, 50.0, 300.0), 299 evas_canvas3d_node_member_add(globalscene.root_node, globalscene.light_node);
321 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
322 EVAS_CANVAS3D_SPACE_PARENT, 1.0, 1.0, 1.0));
323 eo_do(globalscene.root_node,
324 evas_canvas3d_node_member_add(globalscene.light_node));
325 300
326 tmp = 0.01; 301 tmp = 0.01;
327 for (i = 0; i < globalscene.col * globalscene.row; i++) 302 for (i = 0; i < globalscene.col * globalscene.row; i++)
@@ -338,24 +313,22 @@ _init_scene(const char *texture)
338 m->material = spheretmp->material; 313 m->material = spheretmp->material;
339 m->texture = spheretmp->texture; 314 m->texture = spheretmp->texture;
340 } 315 }
341 m->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 316 m->node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
342 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
343 m->speed = tmp; 317 m->speed = tmp;
344 m->sphere_animate = _animate_sphere; 318 m->sphere_animate = _animate_sphere;
345 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m); 319 m->animate = ecore_timer_add(m->speed, m->sphere_animate, m);
346 eo_do(globalscene.root_node, evas_canvas3d_node_member_add(m->node)); 320 evas_canvas3d_node_member_add(globalscene.root_node, m->node);
347 eo_do(m->node, evas_canvas3d_node_mesh_add(m->mesh), 321 evas_canvas3d_node_mesh_add(m->node, m->mesh);
348 evas_canvas3d_node_scale_set(VEC_3(INIT_SCALE))); 322 evas_canvas3d_node_scale_set(m->node, VEC_3(INIT_SCALE));
349 globalscene.spheres = eina_list_append(globalscene.spheres, m); 323 globalscene.spheres = eina_list_append(globalscene.spheres, m);
350 tmp += 0.01; 324 tmp += 0.01;
351 } 325 }
352 326
353 _recalculate_position(); 327 _recalculate_position();
354 328
355 eo_do(globalscene.scene, 329 evas_canvas3d_scene_root_node_set(globalscene.scene, globalscene.root_node);
356 evas_canvas3d_scene_root_node_set(globalscene.root_node), 330 evas_canvas3d_scene_camera_node_set(globalscene.scene, globalscene.camera_node);
357 evas_canvas3d_scene_camera_node_set(globalscene.camera_node), 331 evas_canvas3d_scene_size_set(globalscene.scene, WIDTH, HEIGHT);
358 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
359 return EINA_TRUE; 332 return EINA_TRUE;
360} 333}
361 334
@@ -410,11 +383,10 @@ int main(int argc, char **argv)
410 383
411 image = evas_object_image_filled_add(evas); 384 image = evas_object_image_filled_add(evas);
412 385
413 eo_do(image, 386 efl_gfx_size_set(image, WIDTH, HEIGHT);
414 efl_gfx_size_set(WIDTH, HEIGHT), 387 efl_gfx_visible_set(image, EINA_TRUE);
415 efl_gfx_visible_set(EINA_TRUE));
416 evas_object_focus_set(image, EINA_TRUE); 388 evas_object_focus_set(image, EINA_TRUE);
417 eo_do(image, evas_obj_image_scene_set(globalscene.scene)); 389 evas_obj_image_scene_set(image, globalscene.scene);
418 390
419 r = evas_object_key_grab(image, "Down", 0, 0, EINA_TRUE); 391 r = evas_object_key_grab(image, "Down", 0, 0, EINA_TRUE);
420 r = evas_object_key_grab(image, "Up", 0, 0, EINA_TRUE); 392 r = evas_object_key_grab(image, "Up", 0, 0, EINA_TRUE);
diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c
index eec0234..e393c14 100644
--- a/src/examples/evas/evas-3d-cube-rotate.c
+++ b/src/examples/evas/evas-3d-cube-rotate.c
@@ -89,7 +89,7 @@ _rotate_x_reload(Evas_Canvas3D_Scene *eo_scene, Evas_Event_Mouse_Down *ev, Evas_
89 Evas_Real s, t; 89 Evas_Real s, t;
90 int mouse_diff; 90 int mouse_diff;
91 91
92 eo_do(eo_scene, evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, &s, &t)); 92 evas_canvas3d_scene_pick(eo_scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
93 93
94 if ((n == node) && (m == mesh)) 94 if ((n == node) && (m == mesh))
95 { 95 {
@@ -140,7 +140,7 @@ _animate_scene(void *data)
140 140
141 angle += sc->angle; 141 angle += sc->angle;
142 142
143 eo_do(sc->mesh_node, evas_canvas3d_node_orientation_angle_axis_set(angle, 0, 1.0, 0.0)); 143 evas_canvas3d_node_orientation_angle_axis_set(sc->mesh_node, angle, 0, 1.0, 0.0);
144 144
145 return EINA_TRUE; 145 return EINA_TRUE;
146} 146}
@@ -149,39 +149,32 @@ static void
149_camera_setup(Scene_Data *data) 149_camera_setup(Scene_Data *data)
150{ 150{
151 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 151 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
152 eo_do(data->camera, 152 evas_canvas3d_camera_projection_perspective_set(data->camera, 20.0, 1.0, 2.0, 50.0);
153 evas_canvas3d_camera_projection_perspective_set(20.0, 1.0, 2.0, 50.0));
154 153
155 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 154 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
156 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 155 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
157 eo_do(data->camera_node, 156 evas_canvas3d_node_position_set(data->camera_node, 3.0, 3.0, 10.0);
158 evas_canvas3d_node_camera_set(data->camera), 157 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
159 evas_canvas3d_node_position_set(3.0, 3.0, 10.0),
160 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
161 158
162 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 159 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
163} 160}
164 161
165static void 162static void
166_light_setup(Scene_Data *data) 163_light_setup(Scene_Data *data)
167{ 164{
168 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS,evas); 165 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
169 166
170 eo_do(data->light, 167 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
171 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 168 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
172 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 169 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
173 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
174 170
175 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 171 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
176 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT));
177 172
178 eo_do(data->light_node, 173 evas_canvas3d_node_light_set(data->light_node, data->light);
179 evas_canvas3d_node_light_set(data->light), 174 evas_canvas3d_node_position_set(data->light_node, 5.0, 5.0, 10.0);
180 evas_canvas3d_node_position_set(5.0, 5.0, 10.0), 175 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
181 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
182 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
183 176
184 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node)); 177 evas_canvas3d_node_member_add(data->root_node, data->light_node);
185} 178}
186 179
187static void 180static void
@@ -190,51 +183,44 @@ _mesh_setup(Scene_Data *data)
190 /* Setup material. */ 183 /* Setup material. */
191 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 184 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
192 185
193 eo_do(data->material, 186 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
194 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 187 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
195 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 188 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
196 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 189 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
197 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 190 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
198 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 191 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
199 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 192 evas_canvas3d_material_shininess_set(data->material, 100.0);
200 evas_canvas3d_material_shininess_set(100.0));
201 193
202 /* Setup primitive */ 194 /* Setup primitive */
203 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 195 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
204 eo_do(data->cube, 196 evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
205 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
206 197
207 /* Setup mesh. */ 198 /* Setup mesh. */
208 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 199 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
209 eo_do(data->mesh, 200 evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube);
210 evas_canvas3d_mesh_from_primitive_set(0, data->cube), 201 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
211 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 202 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
212 evas_canvas3d_mesh_frame_material_set(0, data->material)); 203
213 204 data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
214 data->mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 205 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
215 eo_do(data->root_node, 206 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
216 evas_canvas3d_node_member_add(data->mesh_node));
217 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
218} 207}
219 208
220static void 209static void
221_scene_setup(Scene_Data *data) 210_scene_setup(Scene_Data *data)
222{ 211{
223 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 212 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
224 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 213 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
225 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
226 214
227 eo_do(scene, 215 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
228 evas_canvas3d_scene_size_set(WIDTH, HEIGHT), 216 evas_canvas3d_scene_background_color_set(scene, 0.0, 0.0, 0.0, 0.0);
229 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
230 217
231 _camera_setup(data); 218 _camera_setup(data);
232 _light_setup(data); 219 _light_setup(data);
233 _mesh_setup(data); 220 _mesh_setup(data);
234 221
235 eo_do(scene, 222 evas_canvas3d_scene_root_node_set(scene, data->root_node);
236 evas_canvas3d_scene_root_node_set(data->root_node), 223 evas_canvas3d_scene_camera_node_set(scene, data->camera_node);
237 evas_canvas3d_scene_camera_node_set(data->camera_node));
238 224
239 data->mouse_old_x = 0; 225 data->mouse_old_x = 0;
240 data->mouse_diff_x = 0; 226 data->mouse_diff_x = 0;
@@ -276,8 +262,7 @@ main(void)
276 evas_object_show(image); 262 evas_object_show(image);
277 263
278 /* Set the image object as render target for 3D scene. */ 264 /* Set the image object as render target for 3D scene. */
279 eo_do(image, 265 evas_obj_image_scene_set(image, scene);
280 evas_obj_image_scene_set(scene));
281 266
282 evas_object_focus_set(image, EINA_TRUE); 267 evas_object_focus_set(image, EINA_TRUE);
283 268
diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c
index d3bcbbe..6f6f420 100644
--- a/src/examples/evas/evas-3d-cube.c
+++ b/src/examples/evas/evas-3d-cube.c
@@ -110,8 +110,8 @@ _on_canvas_resize(Ecore_Evas *ee)
110 int w, h; 110 int w, h;
111 111
112 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 112 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
113 eo_do(background, efl_gfx_size_set(w, h)); 113 efl_gfx_size_set(background, w, h);
114 eo_do(image, efl_gfx_size_set(w, h)); 114 efl_gfx_size_set(image, w, h);
115} 115}
116 116
117static Eina_Bool 117static Eina_Bool
@@ -122,8 +122,7 @@ _animate_scene(void *data)
122 122
123 angle += 0.5; 123 angle += 0.5;
124 124
125 eo_do(scene->mesh_node, 125 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
126 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
127 126
128 /* Rotate */ 127 /* Rotate */
129 if (angle > 360.0) angle -= 360.0f; 128 if (angle > 360.0) angle -= 360.0f;
@@ -136,38 +135,30 @@ _camera_setup(Scene_Data *data)
136{ 135{
137 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 136 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
138 137
139 eo_do(data->camera, 138 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
140 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
141 139
142 data->camera_node = 140 data->camera_node =
143 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 141 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
144 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 142 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
145 eo_do(data->camera_node, 143 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
146 evas_canvas3d_node_camera_set(data->camera), 144 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
147 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 145 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
148 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
149 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
150 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node));
151} 146}
152 147
153static void 148static void
154_light_setup(Scene_Data *data) 149_light_setup(Scene_Data *data)
155{ 150{
156 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 151 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
157 eo_do(data->light, 152 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
158 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 153 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
159 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 154 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
160 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
161 155
162 data->light_node = 156 data->light_node =
163 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 157 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
164 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 158 evas_canvas3d_node_light_set(data->light_node, data->light);
165 eo_do(data->light_node, 159 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
166 evas_canvas3d_node_light_set(data->light), 160 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
167 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 161 evas_canvas3d_node_member_add(data->root_node, data->light_node);
168 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
169 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
170 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
171} 162}
172static void 163static void
173_mesh_setup(Scene_Data *data) 164_mesh_setup(Scene_Data *data)
@@ -175,65 +166,49 @@ _mesh_setup(Scene_Data *data)
175 /* Setup material. */ 166 /* Setup material. */
176 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 167 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
177 168
178 eo_do(data->material, 169 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
179 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 170 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
180 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 171 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
181 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 172 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
182 173 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
183 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 174 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
184 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 175 evas_canvas3d_material_shininess_set(data->material, 100.0);
185 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
186 evas_canvas3d_material_shininess_set(100.0));
187 176
188 /* Setup mesh. */ 177 /* Setup mesh. */
189 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 178 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
190 eo_do(data->mesh, 179 evas_canvas3d_mesh_vertex_count_set(data->mesh, 24);
191 evas_canvas3d_mesh_vertex_count_set(24), 180 evas_canvas3d_mesh_frame_add(data->mesh, 0);
192 evas_canvas3d_mesh_frame_add(0), 181 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 12 * sizeof(float), &cube_vertices[ 0]);
193 182 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 12 * sizeof(float), &cube_vertices[ 3]);
194 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 183 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, 12 * sizeof(float), &cube_vertices[ 6]);
195 12 * sizeof(float), &cube_vertices[ 0]), 184 evas_canvas3d_mesh_frame_vertex_data_set(data->mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 12 * sizeof(float), &cube_vertices[10]);
196 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 185 evas_canvas3d_mesh_index_data_set(data->mesh, EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 36, &cube_indices[0]);
197 12 * sizeof(float), &cube_vertices[ 3]), 186 evas_canvas3d_mesh_vertex_assembly_set(data->mesh, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
198 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, 187 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
199 12 * sizeof(float), &cube_vertices[ 6]), 188 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material);
200 evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD,
201 12 * sizeof(float), &cube_vertices[10]),
202
203 evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
204 36, &cube_indices[0]),
205 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
206
207 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG),
208
209 evas_canvas3d_mesh_frame_material_set(0, data->material));
210 189
211 data->mesh_node = 190 data->mesh_node =
212 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 191 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
213 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 192 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
214 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 193 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
215 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
216} 194}
217 195
218static void 196static void
219_scene_setup(Scene_Data *data) 197_scene_setup(Scene_Data *data)
220{ 198{
221 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 199 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
222 eo_do(data->scene, 200 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
223 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 201 evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
224 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
225 202
226 data->root_node = 203 data->root_node =
227 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 204 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
228 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
229 205
230 _camera_setup(data); 206 _camera_setup(data);
231 _light_setup(data); 207 _light_setup(data);
232 _mesh_setup(data); 208 _mesh_setup(data);
233 209
234 eo_do(data->scene, 210 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
235 evas_canvas3d_scene_root_node_set(data->root_node), 211 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
236 evas_canvas3d_scene_camera_node_set(data->camera_node));
237} 212}
238 213
239int 214int
@@ -259,19 +234,17 @@ main(void)
259 234
260 /* Add a background rectangle objects. */ 235 /* Add a background rectangle objects. */
261 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 236 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
262 eo_do(background, 237 efl_gfx_color_set(background, 0, 0, 0, 255);
263 efl_gfx_color_set(0, 0, 0, 255), 238 efl_gfx_size_set(background, WIDTH, HEIGHT);
264 efl_gfx_size_set(WIDTH, HEIGHT), 239 efl_gfx_visible_set(background, EINA_TRUE);
265 efl_gfx_visible_set(EINA_TRUE));
266 240
267 /* Add an image object for 3D scene rendering. */ 241 /* Add an image object for 3D scene rendering. */
268 image = evas_object_image_filled_add(evas); 242 image = evas_object_image_filled_add(evas);
269 eo_do(image, 243 efl_gfx_size_set(image, WIDTH, HEIGHT);
270 efl_gfx_size_set(WIDTH, HEIGHT), 244 efl_gfx_visible_set(image, EINA_TRUE);
271 efl_gfx_visible_set(EINA_TRUE));
272 245
273 /* Set the image object as render target for 3D scene. */ 246 /* Set the image object as render target for 3D scene. */
274 eo_do(image, evas_obj_image_scene_set(data.scene)); 247 evas_obj_image_scene_set(image, data.scene);
275 248
276 /* Add animation timer callback. */ 249 /* Add animation timer callback. */
277 ecore_timer_add(0.016, _animate_scene, &data); 250 ecore_timer_add(0.016, _animate_scene, &data);
diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c
index a2dd1fe..e46c2f7 100644
--- a/src/examples/evas/evas-3d-cube2.c
+++ b/src/examples/evas/evas-3d-cube2.c
@@ -79,8 +79,8 @@ _on_canvas_resize(Ecore_Evas *ee)
79 int w, h; 79 int w, h;
80 80
81 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 81 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
82 eo_do(background, efl_gfx_size_set(w, h)); 82 efl_gfx_size_set(background, w, h);
83 eo_do(image, efl_gfx_size_set(w, h)); 83 efl_gfx_size_set(image, w, h);
84} 84}
85 85
86static Eina_Bool 86static Eina_Bool
@@ -93,8 +93,7 @@ _animate_scene(void *data)
93 93
94 angle += 0.2; 94 angle += 0.2;
95 95
96 eo_do(scene->mesh_node, 96 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
97 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
98 97
99 /* Rotate */ 98 /* Rotate */
100 if (angle > 360.0) angle -= 360.0f; 99 if (angle > 360.0) angle -= 360.0f;
@@ -104,7 +103,7 @@ _animate_scene(void *data)
104 if (frame >= 20) inc = -1; 103 if (frame >= 20) inc = -1;
105 else if (frame <= 0) inc = 1; 104 else if (frame <= 0) inc = 1;
106 105
107 eo_do(scene->mesh_node, evas_canvas3d_node_mesh_frame_set(scene->mesh, frame)); 106 evas_canvas3d_node_mesh_frame_set(scene->mesh_node, scene->mesh, frame);
108 107
109 return EINA_TRUE; 108 return EINA_TRUE;
110} 109}
@@ -113,39 +112,30 @@ static void
113_camera_setup(Scene_Data *data) 112_camera_setup(Scene_Data *data)
114{ 113{
115 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 114 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
116 eo_do(data->camera, 115 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
117 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
118 116
119 data->camera_node = 117 data->camera_node =
120 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 118 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
121 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 119 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
122 eo_do(data->camera_node, 120 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 3.0);
123 evas_canvas3d_node_camera_set(data->camera), 121 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
124 evas_canvas3d_node_position_set(0.0, 0.0, 3.0), 122 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
125 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
126 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
127 eo_do(data->root_node,
128 evas_canvas3d_node_member_add(data->camera_node));
129} 123}
130 124
131static void 125static void
132_light_setup(Scene_Data *data) 126_light_setup(Scene_Data *data)
133{ 127{
134 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 128 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
135 eo_do(data->light, 129 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
136 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 130 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
137 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 131 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
138 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
139 132
140 data->light_node = 133 data->light_node =
141 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 134 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
142 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 135 evas_canvas3d_node_light_set(data->light_node, data->light);
143 eo_do(data->light_node, 136 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
144 evas_canvas3d_node_light_set(data->light), 137 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
145 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 138 evas_canvas3d_node_member_add(data->root_node, data->light_node);
146 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
147 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
148 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
149} 139}
150 140
151static void 141static void
@@ -155,86 +145,70 @@ _mesh_setup(Scene_Data *data)
155 data->material0 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 145 data->material0 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
156 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 146 data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
157 147
158 eo_do(data->material0, 148 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
159 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 149 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
160 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 150 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
161 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 151 evas_canvas3d_material_enable_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
162 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 152 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
163 153 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
164 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 154 evas_canvas3d_material_color_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
165 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 155 evas_canvas3d_material_shininess_set(data->material0, 100.0);
166 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 156
167 evas_canvas3d_material_shininess_set(100.0)); 157 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
168 158 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
169 eo_do(data->material1, 159 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
170 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 160 evas_canvas3d_material_enable_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
171 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 161 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
172 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 162 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
173 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 163 evas_canvas3d_material_color_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
174 164 evas_canvas3d_material_shininess_set(data->material1, 100.0);
175 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
176 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
177 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
178 evas_canvas3d_material_shininess_set(100.0));
179 165
180 data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 166 data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
181 data->texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 167 data->texture1 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
182 data->texture_normal = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 168 data->texture_normal = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
183 169
184 eo_do(data->texture0, 170 evas_canvas3d_texture_data_set(data->texture0, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0]);
185 evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels0[0])); 171 evas_canvas3d_texture_data_set(data->texture1, EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]);
186 eo_do(data->texture1, 172 evas_canvas3d_texture_file_set(data->texture_normal, normal_map_path, NULL);
187 evas_canvas3d_texture_data_set(EVAS_COLORSPACE_ARGB8888, 4, 4, &pixels1[0]));
188 eo_do(data->texture_normal,
189 evas_canvas3d_texture_file_set(normal_map_path, NULL));
190 173
191 eo_do(data->material0, 174 evas_canvas3d_material_texture_set(data->material0, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0);
192 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0)); 175 evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1);
193 eo_do(data->material1, 176 evas_canvas3d_material_texture_set(data->material1, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal);
194 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1));
195 eo_do(data->material1,
196 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal));
197 177
198 /* Set data of primitive */ 178 /* Set data of primitive */
199 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 179 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
200 eo_do(data->cube, 180 evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
201 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
202 181
203 /* Setup mesh. */ 182 /* Setup mesh. */
204 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 183 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
205 eo_do(data->mesh, 184 evas_canvas3d_mesh_from_primitive_set(data->mesh, 0, data->cube);
206 evas_canvas3d_mesh_from_primitive_set(0, data->cube), 185 evas_canvas3d_mesh_frame_material_set(data->mesh, 0, data->material0);
207 evas_canvas3d_mesh_frame_material_set(0, data->material0), 186 evas_canvas3d_mesh_frame_add(data->mesh, 20);
208 evas_canvas3d_mesh_frame_add(20), 187 evas_canvas3d_mesh_frame_material_set(data->mesh, 20, data->material1);
209 evas_canvas3d_mesh_frame_material_set(20, data->material1), 188 evas_canvas3d_mesh_shade_mode_set(data->mesh, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP);
210 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP));
211 189
212 data->mesh_node = 190 data->mesh_node =
213 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 191 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
214 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 192 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
215 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 193 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
216 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh));
217} 194}
218 195
219static void 196static void
220_scene_setup(Scene_Data *data) 197_scene_setup(Scene_Data *data)
221{ 198{
222 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 199 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
223 eo_do(data->scene, 200 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
224 evas_canvas3d_scene_size_set(WIDTH, HEIGHT), 201 evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
225 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
226 202
227 data->root_node = 203 data->root_node =
228 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 204 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
229 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
230 205
231 _camera_setup(data); 206 _camera_setup(data);
232 _light_setup(data); 207 _light_setup(data);
233 _mesh_setup(data); 208 _mesh_setup(data);
234 209
235 eo_do(data->scene, 210 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
236 evas_canvas3d_scene_root_node_set(data->root_node), 211 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
237 evas_canvas3d_scene_camera_node_set(data->camera_node));
238} 212}
239 213
240int 214int
@@ -261,19 +235,17 @@ main(void)
261 235
262 /* Add a background rectangle objects. */ 236 /* Add a background rectangle objects. */
263 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 237 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
264 eo_do(background, 238 efl_gfx_color_set(background, 0, 0, 0, 255);
265 efl_gfx_color_set(0, 0, 0, 255), 239 efl_gfx_size_set(background, WIDTH, HEIGHT);
266 efl_gfx_size_set(WIDTH, HEIGHT), 240 efl_gfx_visible_set(background, EINA_TRUE);
267 efl_gfx_visible_set(EINA_TRUE));
268 241
269 /* Add an image object for 3D scene rendering. */ 242 /* Add an image object for 3D scene rendering. */
270 image = evas_object_image_filled_add(evas); 243 image = evas_object_image_filled_add(evas);
271 eo_do(image, 244 efl_gfx_size_set(image, WIDTH, HEIGHT);
272 efl_gfx_size_set(WIDTH, HEIGHT), 245 efl_gfx_visible_set(image, EINA_TRUE);
273 efl_gfx_visible_set(EINA_TRUE));
274 246
275 /* Set the image object as render target for 3D scene. */ 247 /* Set the image object as render target for 3D scene. */
276 eo_do(image, evas_obj_image_scene_set(data.scene)); 248 evas_obj_image_scene_set(image, data.scene);
277 249
278 /* Add animation timer callback. */ 250 /* Add animation timer callback. */
279 ecore_timer_add(0.01, _animate_scene, &data); 251 ecore_timer_add(0.01, _animate_scene, &data);
diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c
index 9067825..dc09191 100644
--- a/src/examples/evas/evas-3d-eet.c
+++ b/src/examples/evas/evas-3d-eet.c
@@ -58,8 +58,7 @@ _animate_eet(void *data)
58{ 58{
59 angle += 0.5; 59 angle += 0.5;
60 60
61 eo_do((Evas_Canvas3D_Node *)data, 61 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, angle, 1.0, 1.0, 1.0);
62 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
63 62
64 /* Rotate */ 63 /* Rotate */
65 if (angle > 360.0) angle -= 360.0f; 64 if (angle > 360.0) angle -= 360.0f;
@@ -72,7 +71,7 @@ _animate_md2(void *data)
72{ 71{
73 static int frame = 0; 72 static int frame = 0;
74 73
75 eo_do((Evas_Canvas3D_Node *)data, evas_canvas3d_node_mesh_frame_set(mesh, frame)); 74 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh, frame);
76 75
77 frame += 32; 76 frame += 32;
78 77
@@ -93,8 +92,8 @@ _on_canvas_resize(Ecore_Evas *ee)
93 int w, h; 92 int w, h;
94 93
95 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 94 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
96 eo_do(background, efl_gfx_size_set(w, h)); 95 efl_gfx_size_set(background, w, h);
97 eo_do(image, efl_gfx_size_set(w, h)); 96 efl_gfx_size_set(image, w, h);
98} 97}
99 98
100int 99int
@@ -119,113 +118,86 @@ main(void)
119 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 118 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
120 119
121 /* Add the root node for the scene. */ 120 /* Add the root node for the scene. */
122 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 121 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
123 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
124 122
125 /* Add the camera. */ 123 /* Add the camera. */
126 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 124 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
127 eo_do(camera, 125 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
128 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0)); 126
129 127 camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
130 camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 128 evas_canvas3d_node_camera_set(camera_node, camera);
131 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 129 evas_canvas3d_node_member_add(root_node, camera_node);
132 eo_do(camera_node, 130 evas_canvas3d_node_position_set(camera_node, 200.0, 0.0, 40.0);
133 evas_canvas3d_node_camera_set(camera)); 131 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
134 eo_do(root_node,
135 evas_canvas3d_node_member_add(camera_node));
136 eo_do(camera_node,
137 evas_canvas3d_node_position_set(200.0, 0.0, 40.0),
138 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0,
139 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
140 /* Add the light. */ 132 /* Add the light. */
141 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 133 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
142 eo_do(light, 134 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
143 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 135 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
144 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 136 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
145 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 137 evas_canvas3d_light_directional_set(light, EINA_TRUE);
146 evas_canvas3d_light_directional_set(EINA_TRUE)); 138
147 139 light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
148 light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 140 evas_canvas3d_node_light_set(light_node, light);
149 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 141 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
150 eo_do(light_node, 142 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
151 evas_canvas3d_node_light_set(light), 143 evas_canvas3d_node_member_add(root_node, light_node);
152 evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0),
153 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
154 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
155 eo_do(root_node,
156 evas_canvas3d_node_member_add(light_node));
157 144
158 /* Add the meshes. */ 145 /* Add the meshes. */
159 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 146 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
160 mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 147 mesh2 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
161 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 148 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
162 149
163 eo_do(mesh, 150 efl_file_set(mesh, input_model_path, NULL);
164 efl_file_set(input_model_path, NULL), 151 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
165 evas_canvas3d_mesh_frame_material_set(0, material), 152 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
166 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG)); 153
167 154 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
168 eo_do(material, 155 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
169 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 156 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
170 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 157 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
171 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 158 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.50, 0.50, 0.00, 0.30);
172 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 159 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.00, 0.50, 0.50, 0.30);
173 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 160 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.50, 0.00, 0.50, 0.30);
174 0.50, 0.50, 0.00, 0.30), 161 evas_canvas3d_material_shininess_set(material, 50.0);
175 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
176 0.00, 0.50, 0.50, 0.30),
177 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
178 0.50, 0.00, 0.50, 0.30),
179 evas_canvas3d_material_shininess_set(50.0));
180 162
181 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES)) 163 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES))
182 fprintf(stderr, "Failed to create folder %s\n\n", 164 fprintf(stderr, "Failed to create folder %s\n\n",
183 PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES); 165 PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES);
184 166
185 eo_do(mesh, efl_file_save(output_model_path, NULL, NULL)); 167 efl_file_save(mesh, output_model_path, NULL, NULL);
186 168
187 eo_do(mesh2, 169 efl_file_set(mesh2, output_model_path, NULL);
188 efl_file_set(output_model_path, NULL), 170 evas_canvas3d_mesh_shade_mode_set(mesh2, EVAS_CANVAS3D_SHADE_MODE_PHONG);
189 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
190 171
191 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 172 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
192 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
193 173
194 eo_do(root_node, 174 evas_canvas3d_node_member_add(root_node, mesh_node);
195 evas_canvas3d_node_member_add(mesh_node)); 175 evas_canvas3d_node_mesh_add(mesh_node, mesh);
196 eo_do(mesh_node, 176 evas_canvas3d_node_position_set(mesh_node, 0.0, -40.0, 0.0);
197 evas_canvas3d_node_mesh_add(mesh),
198 evas_canvas3d_node_position_set(0.0, -40.0, 0.0));
199 177
200 mesh_node2 = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 178 mesh_node2 = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
201 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 179 evas_canvas3d_node_member_add(root_node, mesh_node2);
202 eo_do(root_node, 180 evas_canvas3d_node_mesh_add(mesh_node2, mesh2);
203 evas_canvas3d_node_member_add(mesh_node2)); 181 evas_canvas3d_node_position_set(mesh_node2, 0.0, 40.0, 0.0);
204 eo_do(mesh_node2,
205 evas_canvas3d_node_mesh_add(mesh2),
206 evas_canvas3d_node_position_set(0.0, 40.0, 0.0));
207 182
208 /* Set up scene. */ 183 /* Set up scene. */
209 eo_do(scene, 184 evas_canvas3d_scene_root_node_set(scene, root_node);
210 evas_canvas3d_scene_root_node_set(root_node), 185 evas_canvas3d_scene_camera_node_set(scene, camera_node);
211 evas_canvas3d_scene_camera_node_set(camera_node), 186 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
212 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
213 187
214 /* Add a background rectangle objects. */ 188 /* Add a background rectangle objects. */
215 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 189 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
216 eo_do(background, 190 efl_gfx_color_set(background, 0, 0, 0, 255);
217 efl_gfx_color_set(0, 0, 0, 255), 191 efl_gfx_size_set(background, WIDTH, HEIGHT);
218 efl_gfx_size_set(WIDTH, HEIGHT), 192 efl_gfx_visible_set(background, EINA_TRUE);
219 efl_gfx_visible_set(EINA_TRUE));
220 193
221 /* Add an image object for 3D scene rendering. */ 194 /* Add an image object for 3D scene rendering. */
222 image = evas_object_image_filled_add(evas); 195 image = evas_object_image_filled_add(evas);
223 eo_do(image, 196 efl_gfx_size_set(image, WIDTH, HEIGHT);
224 efl_gfx_size_set(WIDTH, HEIGHT), 197 efl_gfx_visible_set(image, EINA_TRUE);
225 efl_gfx_visible_set(EINA_TRUE));
226 198
227 /* Set the image object as render target for 3D scene. */ 199 /* Set the image object as render target for 3D scene. */
228 eo_do(image, evas_obj_image_scene_set(scene)); 200 evas_obj_image_scene_set(image, scene);
229 201
230 ecore_timer_add(0.01, _animate_md2, mesh_node); 202 ecore_timer_add(0.01, _animate_md2, mesh_node);
231 ecore_timer_add(0.01, _animate_eet, mesh_node2); 203 ecore_timer_add(0.01, _animate_eet, mesh_node2);
diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c
index 5d191e8..33bd05c 100644
--- a/src/examples/evas/evas-3d-fog.c
+++ b/src/examples/evas/evas-3d-fog.c
@@ -59,8 +59,8 @@ _on_canvas_resize(Ecore_Evas *ee)
59 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 59 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
60 60
61 evas_object_resize(background, w, h); 61 evas_object_resize(background, w, h);
62 eo_do(background, efl_gfx_size_set(w, h)); 62 efl_gfx_size_set(background, w, h);
63 eo_do(image, efl_gfx_size_set(w, h)); 63 efl_gfx_size_set(image, w, h);
64} 64}
65 65
66static Eina_Bool 66static Eina_Bool
@@ -71,8 +71,7 @@ _animate_scene(void *data)
71 71
72 angle += 0.5; 72 angle += 0.5;
73 73
74 eo_do(scene->animation_node, 74 evas_canvas3d_node_orientation_angle_axis_set(scene->animation_node, angle, 0.0, 1.0, 0.0);
75 evas_canvas3d_node_orientation_angle_axis_set(angle, 0.0, 1.0, 0.0));
76 75
77 if (angle > 360.0) angle -= 360.0f; 76 if (angle > 360.0) angle -= 360.0f;
78 77
@@ -84,49 +83,40 @@ _camera_setup(Scene_Data *data)
84{ 83{
85 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 84 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
86 85
87 eo_do(data->camera, 86 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
88 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
89 87
90 data->camera_node = 88 data->camera_node =
91 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 89 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
92 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA));
93 90
94 eo_do(data->camera_node, 91 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
95 evas_canvas3d_node_camera_set(data->camera), 92 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0);
96 evas_canvas3d_node_position_set(0.0, 0.0, 7.0), 93 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
97 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
98 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
99 94
100 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 95 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
101} 96}
102 97
103static void 98static void
104_light_setup(Scene_Data *data) 99_light_setup(Scene_Data *data)
105{ 100{
106 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 101 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
107 eo_do(data->light, 102 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
108 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 103 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
109 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 104 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
110 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
111 105
112 data->light_node = 106 data->light_node =
113 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 107 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
114 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 108 evas_canvas3d_node_light_set(data->light_node, data->light);
115 eo_do(data->light_node, 109 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
116 evas_canvas3d_node_light_set(data->light), 110 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
117 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 111 evas_canvas3d_node_member_add(data->root_node, data->light_node);
118 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
119 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
120 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
121} 112}
122 113
123static void 114static void
124_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) 115_set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material)
125{ 116{
126 eo_do(mesh, 117 evas_canvas3d_mesh_from_primitive_set(mesh, 0, sphere);
127 evas_canvas3d_mesh_from_primitive_set(0, sphere), 118 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
128 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 119 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
129 evas_canvas3d_mesh_frame_material_set(0, material));
130} 120}
131 121
132 122
@@ -135,20 +125,17 @@ _mesh_setup(Scene_Data *data)
135{ 125{
136 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 126 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
137 127
138 eo_do(data->material, 128 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
139 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 129 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
140 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 130 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
141 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 131 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
142 132 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
143 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 133 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
144 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 134 evas_canvas3d_material_shininess_set(data->material, 100.0);
145 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
146 evas_canvas3d_material_shininess_set(100.0));
147 135
148 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 136 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
149 eo_do(data->sphere, 137 evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
150 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 138 evas_canvas3d_primitive_precision_set(data->sphere, 50);
151 evas_canvas3d_primitive_precision_set(50));
152 139
153 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 140 data->mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
154 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 141 data->mesh1 = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
@@ -157,28 +144,27 @@ _mesh_setup(Scene_Data *data)
157 _set_ball(data->mesh1, data->sphere, data->material); 144 _set_ball(data->mesh1, data->sphere, data->material);
158 145
159 data->animation_node = 146 data->animation_node =
160 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 147 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
161 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
162 148
163 data->mesh_node = 149 data->mesh_node =
164 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 150 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
165 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
166 151
167 eo_do(data->animation_node, evas_canvas3d_node_member_add(data->mesh_node)); 152 evas_canvas3d_node_member_add(data->animation_node, data->mesh_node);
168 eo_do(data->root_node, evas_canvas3d_node_member_add(data->animation_node)); 153 evas_canvas3d_node_member_add(data->root_node, data->animation_node);
169 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh), 154 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh);
170 evas_canvas3d_node_position_set(0.0, 0.0, 3.0)); 155 evas_canvas3d_node_position_set(data->mesh_node, 0.0, 0.0, 3.0);
171 156
172 data->mesh_node1 = 157 data->mesh_node1 =
173 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 158 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
174 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
175 159
176 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node1)); 160 evas_canvas3d_node_member_add(data->root_node, data->mesh_node1);
177 eo_do(data->mesh_node1, evas_canvas3d_node_mesh_add(data->mesh1), 161 evas_canvas3d_node_mesh_add(data->mesh_node1, data->mesh1);
178 evas_canvas3d_node_scale_set(3, 3, 3)); 162 evas_canvas3d_node_scale_set(data->mesh_node1, 3, 3, 3);
179 163
180 eo_do(data->mesh, evas_canvas3d_mesh_fog_enable_set(EINA_TRUE), evas_canvas3d_mesh_fog_color_set(FOG_COLOR, FOG_FACTOR)); 164 evas_canvas3d_mesh_fog_enable_set(data->mesh, EINA_TRUE);
181 eo_do(data->mesh1, evas_canvas3d_mesh_fog_enable_set(EINA_TRUE), evas_canvas3d_mesh_fog_color_set(FOG_COLOR, FOG_FACTOR)); 165 evas_canvas3d_mesh_fog_color_set(data->mesh, FOG_COLOR, FOG_FACTOR);
166 evas_canvas3d_mesh_fog_enable_set(data->mesh1, EINA_TRUE);
167 evas_canvas3d_mesh_fog_color_set(data->mesh1, FOG_COLOR, FOG_FACTOR);
182} 168}
183 169
184static void 170static void
@@ -186,21 +172,18 @@ _scene_setup(Scene_Data *data)
186{ 172{
187 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 173 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
188 174
189 eo_do(data->scene, 175 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
190 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 176 evas_canvas3d_scene_background_color_set(data->scene, FOG_COLOR, 1);
191 evas_canvas3d_scene_background_color_set(FOG_COLOR, 1));
192 177
193 data->root_node = 178 data->root_node =
194 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 179 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
195 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
196 180
197 _camera_setup(data); 181 _camera_setup(data);
198 _light_setup(data); 182 _light_setup(data);
199 _mesh_setup(data); 183 _mesh_setup(data);
200 184
201 eo_do(data->scene, 185 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
202 evas_canvas3d_scene_root_node_set(data->root_node), 186 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
203 evas_canvas3d_scene_camera_node_set(data->camera_node));
204} 187}
205 188
206int 189int
@@ -227,20 +210,18 @@ main(void)
227 210
228 /* Add a background rectangle objects. */ 211 /* Add a background rectangle objects. */
229 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 212 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
230 eo_do(background, 213 efl_gfx_color_set(background, 0, 0, 0, 255);
231 efl_gfx_color_set(0, 0, 0, 255), 214 efl_gfx_size_set(background, WIDTH, HEIGHT);
232 efl_gfx_size_set(WIDTH, HEIGHT), 215 efl_gfx_visible_set(background, EINA_TRUE);
233 efl_gfx_visible_set(EINA_TRUE));
234 216
235 /* Add an image object for 3D scene rendering. */ 217 /* Add an image object for 3D scene rendering. */
236 image = evas_object_image_filled_add(evas); 218 image = evas_object_image_filled_add(evas);
237 219
238 eo_do(image, 220 efl_gfx_size_set(image, WIDTH, HEIGHT);
239 efl_gfx_size_set(WIDTH, HEIGHT), 221 efl_gfx_visible_set(image, EINA_TRUE);
240 efl_gfx_visible_set(EINA_TRUE));
241 222
242 /* Set the image object as render target for 3D scene. */ 223 /* Set the image object as render target for 3D scene. */
243 eo_do(image, evas_obj_image_scene_set(data.scene)); 224 evas_obj_image_scene_set(image, data.scene);
244 225
245 /* Add animation timer callback. */ 226 /* Add animation timer callback. */
246 ecore_animator_frametime_set(0.008); 227 ecore_animator_frametime_set(0.008);
diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c
index 94d43f2..4e1323f 100644
--- a/src/examples/evas/evas-3d-frustum.c
+++ b/src/examples/evas/evas-3d-frustum.c
@@ -100,18 +100,17 @@ _redraw_bounding_object(void *data)
100 Eo *current_mesh; 100 Eo *current_mesh;
101 Eina_List *meshes = NULL, *l; 101 Eina_List *meshes = NULL, *l;
102 102
103 eo_do(scene->mesh_node, meshes = (Eina_List *)evas_canvas3d_node_mesh_list_get()); 103 meshes = (Eina_List *)evas_canvas3d_node_mesh_list_get(scene->mesh_node);
104 EINA_LIST_FOREACH(meshes, l, current_mesh) 104 EINA_LIST_FOREACH(meshes, l, current_mesh)
105 { 105 {
106 eo_do(scene->mesh_node, evas_canvas3d_node_mesh_del(current_mesh)); 106 evas_canvas3d_node_mesh_del(scene->mesh_node, current_mesh);
107 } 107 }
108 108
109 switch (key) 109 switch (key)
110 { 110 {
111 case EVAS_CANVAS3D_FRUSTUM_MODE_BSPHERE: 111 case EVAS_CANVAS3D_FRUSTUM_MODE_BSPHERE:
112 { 112 {
113 eo_do(scene->mesh_node_model, 113 evas_canvas3d_node_bounding_sphere_get(scene->mesh_node_model, &x0, &y0, &z0, &rad);
114 evas_canvas3d_node_bounding_sphere_get(&x0, &y0, &z0, &rad));
115 current_mesh = scene->mesh_sphere; 114 current_mesh = scene->mesh_sphere;
116 px = x0; 115 px = x0;
117 py = y0; 116 py = y0;
@@ -121,9 +120,7 @@ _redraw_bounding_object(void *data)
121 } 120 }
122 case EVAS_CANVAS3D_FRUSTUM_MODE_AABB: 121 case EVAS_CANVAS3D_FRUSTUM_MODE_AABB:
123 { 122 {
124 eo_do(scene->mesh_node_model, 123 evas_canvas3d_node_bounding_box_get(scene->mesh_node_model, &x0, &y0, &z0, &x1, &y1, &z1);
125 evas_canvas3d_node_bounding_box_get(&x0, &y0, &z0,
126 &x1, &y1, &z1));
127 current_mesh = scene->mesh_aabb; 124 current_mesh = scene->mesh_aabb;
128 px = (x1 + x0) / 2; 125 px = (x1 + x0) / 2;
129 py = (y1 + y0) / 2; 126 py = (y1 + y0) / 2;
@@ -135,8 +132,7 @@ _redraw_bounding_object(void *data)
135 } 132 }
136 case EVAS_CANVAS3D_FRUSTUM_MODE_CENTRAL_POINT: 133 case EVAS_CANVAS3D_FRUSTUM_MODE_CENTRAL_POINT:
137 { 134 {
138 eo_do(scene->mesh_node_model, 135 evas_canvas3d_node_bounding_sphere_get(scene->mesh_node_model, &x0, &y0, &z0, &rad);
139 evas_canvas3d_node_bounding_sphere_get(&x0, &y0, &z0, &rad));
140 current_mesh = scene->mesh_sphere; 136 current_mesh = scene->mesh_sphere;
141 px = x0; 137 px = x0;
142 py = y0; 138 py = y0;
@@ -148,10 +144,9 @@ _redraw_bounding_object(void *data)
148 return ECORE_CALLBACK_RENEW; 144 return ECORE_CALLBACK_RENEW;
149 } 145 }
150 146
151 eo_do(scene->mesh_node, 147 evas_canvas3d_node_mesh_add(scene->mesh_node, current_mesh);
152 evas_canvas3d_node_mesh_add(current_mesh), 148 evas_canvas3d_node_position_set(scene->mesh_node, px, py, pz);
153 evas_canvas3d_node_position_set(px, py, pz), 149 evas_canvas3d_node_scale_set(scene->mesh_node, sx, sy, sz);
154 evas_canvas3d_node_scale_set(sx, sy, sz));
155 150
156 return ECORE_CALLBACK_RENEW; 151 return ECORE_CALLBACK_RENEW;
157} 152}
@@ -166,109 +161,97 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
166 if (!strcmp("w", ev->key)) 161 if (!strcmp("w", ev->key))
167 { 162 {
168 ffar += 20; 163 ffar += 20;
169 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 164 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
170 } 165 }
171 else if(!strcmp("s", ev->key)) 166 else if(!strcmp("s", ev->key))
172 { 167 {
173 ffar -= 20; 168 ffar -= 20;
174 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 169 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
175 } 170 }
176 else if(!strcmp("t", ev->key)) 171 else if(!strcmp("t", ev->key))
177 { 172 {
178 fnear += 2; 173 fnear += 2;
179 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 174 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
180 } 175 }
181 else if(!strcmp("g", ev->key)) 176 else if(!strcmp("g", ev->key))
182 { 177 {
183 fnear -= 2; 178 fnear -= 2;
184 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 179 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
185 } 180 }
186 else if(!strcmp("i", ev->key)) 181 else if(!strcmp("i", ev->key))
187 { 182 {
188 obj_y++; 183 obj_y++;
189 eo_do(scene->mesh_node_model, 184 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
190 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
191 } 185 }
192 else if(!strcmp("k", ev->key)) 186 else if(!strcmp("k", ev->key))
193 { 187 {
194 obj_y--; 188 obj_y--;
195 eo_do(scene->mesh_node_model, 189 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
196 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
197 } 190 }
198 else if(!strcmp("o", ev->key)) 191 else if(!strcmp("o", ev->key))
199 { 192 {
200 obj_z++; 193 obj_z++;
201 eo_do(scene->mesh_node_model, 194 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
202 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
203 } 195 }
204 else if(!strcmp("u", ev->key)) 196 else if(!strcmp("u", ev->key))
205 { 197 {
206 obj_z--; 198 obj_z--;
207 eo_do(scene->mesh_node_model, 199 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
208 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
209 } 200 }
210 else if(!strcmp("l", ev->key)) 201 else if(!strcmp("l", ev->key))
211 { 202 {
212 obj_x++; 203 obj_x++;
213 eo_do(scene->mesh_node_model, 204 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
214 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
215 } 205 }
216 else if(!strcmp("j", ev->key)) 206 else if(!strcmp("j", ev->key))
217 { 207 {
218 obj_x--; 208 obj_x--;
219 eo_do(scene->mesh_node_model, 209 evas_canvas3d_node_position_set(scene->mesh_node_model, obj_x, obj_y, obj_z);
220 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z));
221 } 210 }
222 else if(!strcmp("z", ev->key)) 211 else if(!strcmp("z", ev->key))
223 { 212 {
224 obj_sc_y+=0.02; 213 obj_sc_y+=0.02;
225 eo_do(scene->mesh_node_model, 214 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
226 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
227 } 215 }
228 else if(!strcmp("Z", ev->key)) 216 else if(!strcmp("Z", ev->key))
229 { 217 {
230 obj_sc_y-=0.02; 218 obj_sc_y-=0.02;
231 eo_do(scene->mesh_node_model, 219 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
232 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
233 } 220 }
234 else if(!strcmp("x", ev->key)) 221 else if(!strcmp("x", ev->key))
235 { 222 {
236 obj_sc_z+=0.02; 223 obj_sc_z+=0.02;
237 eo_do(scene->mesh_node_model, 224 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
238 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
239 } 225 }
240 else if(!strcmp("X", ev->key)) 226 else if(!strcmp("X", ev->key))
241 { 227 {
242 obj_sc_z-=0.02; 228 obj_sc_z-=0.02;
243 eo_do(scene->mesh_node_model, 229 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
244 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
245 } 230 }
246 else if(!strcmp("c", ev->key)) 231 else if(!strcmp("c", ev->key))
247 { 232 {
248 obj_sc_x+=0.02; 233 obj_sc_x+=0.02;
249 eo_do(scene->mesh_node_model, 234 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
250 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
251 } 235 }
252 else if(!strcmp("C", ev->key)) 236 else if(!strcmp("C", ev->key))
253 { 237 {
254 obj_sc_x-=0.02; 238 obj_sc_x-=0.02;
255 eo_do(scene->mesh_node_model, 239 evas_canvas3d_node_scale_set(scene->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
256 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z));
257 } 240 }
258 else if(!strcmp("Return", ev->key)) 241 else if(!strcmp("Return", ev->key))
259 { 242 {
260 eo_do(scene->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 243 evas_canvas3d_camera_projection_frustum_set(scene->camera, fleft, fright, fbottom, fup, fnear, ffar);
261 } 244 }
262 else if (!strcmp("1", ev->key)) 245 else if (!strcmp("1", ev->key))
263 { 246 {
264 eo_do(scene->camera_node, evas_canvas3d_node_position_set(0.0, 0.0, 300.0), 247 evas_canvas3d_node_position_set(scene->camera_node, 0.0, 0.0, 300.0);
265 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 248 evas_canvas3d_node_look_at_set(scene->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
266 fprintf(stdout, "Changed position and view of camera\n"); 249 fprintf(stdout, "Changed position and view of camera\n");
267 } 250 }
268 else if (!strcmp("2", ev->key)) 251 else if (!strcmp("2", ev->key))
269 { 252 {
270 eo_do(scene->camera_node, evas_canvas3d_node_position_set(300.0, 300.0, 300.0); 253 evas_canvas3d_node_position_set(scene->camera_node, 300.0, 300.0, 300.0);
271 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0)); 254 evas_canvas3d_node_look_at_set(scene->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
272 fprintf(stdout, "Changed position and view of camera\n"); 255 fprintf(stdout, "Changed position and view of camera\n");
273 } 256 }
274 else if (!strcmp("3", ev->key)) 257 else if (!strcmp("3", ev->key))
@@ -289,7 +272,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
289 } 272 }
290 273
291 _redraw_bounding_object(data); 274 _redraw_bounding_object(data);
292 eo_do(scene->camera, frustum = evas_canvas3d_camera_node_visible_get(scene->camera_node, scene->mesh_node_model, key)); 275 frustum = evas_canvas3d_camera_node_visible_get(scene->camera, scene->camera_node, scene->mesh_node_model, key);
293 fprintf(stdout, "far - %f frustum - %d radius - %f\n", ffar, frustum, radius); 276 fprintf(stdout, "far - %f frustum - %d radius - %f\n", ffar, frustum, radius);
294} 277}
295 278
@@ -297,35 +280,30 @@ static void
297_camera_setup(Scene_Data *data) 280_camera_setup(Scene_Data *data)
298{ 281{
299 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 282 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
300 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 283 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
301 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 284 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
302 eo_do(data->camera_node, 285 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 300.0);
303 evas_canvas3d_node_camera_set(data->camera), 286 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
304 evas_canvas3d_node_position_set(0.0, 0.0, 300.0);
305 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
306 287
307 eo_do(data->camera, evas_canvas3d_camera_projection_frustum_set(fleft, fright, fbottom, fup, fnear, ffar)); 288 evas_canvas3d_camera_projection_frustum_set(data->camera, fleft, fright, fbottom, fup, fnear, ffar);
308 289
309 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node)); 290 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
310} 291}
311 292
312static void 293static void
313_light_setup(Scene_Data *data) 294_light_setup(Scene_Data *data)
314{ 295{
315 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 296 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
316 eo_do(data->light, 297 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
317 evas_canvas3d_light_ambient_set( 0.2, 0.2, 0.2, 1.0), 298 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
318 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 299 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
319 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0)); 300
320 301 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
321 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS,evas, 302 evas_canvas3d_node_light_set(data->light_node, data->light);
322 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 303 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 200.0);
323 eo_do(data->light_node, 304 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
324 evas_canvas3d_node_light_set(data->light), 305
325 evas_canvas3d_node_position_set(0.0, 0.0, 200.0), 306 evas_canvas3d_node_member_add(data->root_node, data->light_node);
326 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
327
328 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
329} 307}
330 308
331static void 309static void
@@ -333,43 +311,37 @@ _mesh_setup(Scene_Data *data)
333{ 311{
334 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 312 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
335 313
336 eo_do(data->material, 314 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
337 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 315 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
338 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 316 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
339 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 317 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
340 318 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
341 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 319 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
342 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 320 evas_canvas3d_material_shininess_set(data->material, 100.0);
343 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
344 evas_canvas3d_material_shininess_set(100.0));
345 321
346 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 322 data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
347 eo_do(data->cube, 323 evas_canvas3d_primitive_form_set(data->cube, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
348 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE));
349 324
350 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 325 data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
351 eo_do(data->sphere, 326 evas_canvas3d_primitive_form_set(data->sphere, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
352 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 327 evas_canvas3d_primitive_precision_set(data->sphere, 20);
353 evas_canvas3d_primitive_precision_set(20));
354 328
355 data->mesh_aabb = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 329 data->mesh_aabb = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
356 eo_do(data->mesh_aabb, 330 evas_canvas3d_mesh_from_primitive_set(data->mesh_aabb, 0, data->cube);
357 evas_canvas3d_mesh_from_primitive_set(0, data->cube), 331 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_aabb, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
358 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES), 332 evas_canvas3d_mesh_shade_mode_set(data->mesh_aabb, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE);
359 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE), 333 evas_canvas3d_mesh_frame_material_set(data->mesh_aabb, 0, data->material);
360 evas_canvas3d_mesh_frame_material_set(0, data->material));
361 334
362 data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 335 data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
363 eo_do(data->mesh_sphere, 336 evas_canvas3d_mesh_from_primitive_set(data->mesh_sphere, 0, data->sphere);
364 evas_canvas3d_mesh_from_primitive_set(0, data->sphere), 337 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_sphere, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
365 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES), 338 evas_canvas3d_mesh_shade_mode_set(data->mesh_sphere, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE);
366 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE), 339 evas_canvas3d_mesh_frame_material_set(data->mesh_sphere, 0, data->material);
367 evas_canvas3d_mesh_frame_material_set(0, data->material));
368 340
369 data->mesh_node = 341 data->mesh_node =
370 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 342 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
371 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 343 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
372 eo_do(data->mesh_node, evas_canvas3d_node_mesh_add(data->mesh_aabb)); 344 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_aabb);
373} 345}
374 346
375static void 347static void
@@ -379,27 +351,24 @@ _mesh_setup_model(Scene_Data *data)
379 data->material_model = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 351 data->material_model = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
380 data->texture_model = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 352 data->texture_model = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
381 353
382 eo_do(data->texture_model, 354 evas_canvas3d_texture_file_set(data->texture_model, texture_path, NULL);
383 evas_canvas3d_texture_file_set(texture_path, NULL), 355 evas_canvas3d_texture_filter_set(data->texture_model, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
384 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 356 evas_canvas3d_texture_wrap_set(data->texture_model, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
385 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 357
386 358 evas_canvas3d_material_enable_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
387 eo_do(data->material_model, 359 evas_canvas3d_material_enable_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
388 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 360 evas_canvas3d_material_enable_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
389 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 361 evas_canvas3d_material_enable_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
390 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 362 evas_canvas3d_material_enable_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
391 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE); 363 evas_canvas3d_material_color_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
392 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 364 evas_canvas3d_material_color_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
393 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0), 365 evas_canvas3d_material_color_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
394 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0), 366 evas_canvas3d_material_texture_set(data->material_model, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_model);
395 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 367 evas_canvas3d_material_shininess_set(data->material_model, 100.0);
396 evas_canvas3d_material_texture_set( EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_model), 368
397 evas_canvas3d_material_shininess_set(100.0)); 369 efl_file_set(data->mesh_model, mesh_path, NULL);
398 370 evas_canvas3d_mesh_frame_material_set(data->mesh_model, 0, data->material_model);
399 eo_do(data->mesh_model, 371 evas_canvas3d_mesh_shade_mode_set(data->mesh_model, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE);
400 efl_file_set(mesh_path, NULL),
401 evas_canvas3d_mesh_frame_material_set(0, data->material_model),
402 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE));
403} 372}
404 373
405static void 374static void
@@ -407,29 +376,25 @@ _scene_setup(Scene_Data *data)
407{ 376{
408 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 377 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
409 378
410 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 379 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
411 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
412 380
413 _light_setup(data); 381 _light_setup(data);
414 _mesh_setup_model(data); 382 _mesh_setup_model(data);
415 _camera_setup(data); 383 _camera_setup(data);
416 384
417 data->mesh_node_model = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 385 data->mesh_node_model = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
418 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 386 evas_canvas3d_node_position_set(data->mesh_node_model, obj_x, obj_y, obj_z);
419 eo_do(data->mesh_node_model, 387 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_model, -90, 1.0, 0.0, 0.0);
420 evas_canvas3d_node_position_set(obj_x, obj_y, obj_z), 388 evas_canvas3d_node_scale_set(data->mesh_node_model, obj_sc_x, obj_sc_y, obj_sc_z);
421 evas_canvas3d_node_orientation_angle_axis_set(-90, 1.0, 0.0, 0.0), 389 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_model);
422 evas_canvas3d_node_scale_set(obj_sc_x, obj_sc_y, obj_sc_z)); 390 evas_canvas3d_node_mesh_add(data->mesh_node_model, data->mesh_model);
423 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node_model));
424 eo_do(data->mesh_node_model, evas_canvas3d_node_mesh_add(data->mesh_model));
425 391
426 _mesh_setup(data); 392 _mesh_setup(data);
427 393
428 eo_do(data->scene, 394 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
429 evas_canvas3d_scene_size_set( WIDTH, HEIGHT), 395 evas_canvas3d_scene_background_color_set(data->scene, 0.5, 0.5, 0.5, 0.0);
430 evas_canvas3d_scene_background_color_set(0.5, 0.5, 0.5, 0.0), 396 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
431 evas_canvas3d_scene_root_node_set(data->root_node); 397 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
432 evas_canvas3d_scene_camera_node_set(data->camera_node));
433} 398}
434 399
435int 400int
@@ -466,7 +431,7 @@ main(void)
466 evas_object_show(image); 431 evas_object_show(image);
467 432
468 evas_object_focus_set(image, EINA_TRUE); 433 evas_object_focus_set(image, EINA_TRUE);
469 eo_do(image, evas_obj_image_scene_set(data.scene)); 434 evas_obj_image_scene_set(image, data.scene);
470 435
471 _redraw_bounding_object(&data); 436 _redraw_bounding_object(&data);
472 _show_help(); 437 _show_help();
diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c
index 31748dc..4877884 100644
--- a/src/examples/evas/evas-3d-hull.c
+++ b/src/examples/evas/evas-3d-hull.c
@@ -85,58 +85,52 @@ int rr;
85 85
86#define MODEL_MESH_INIT(name, model, shade) \ 86#define MODEL_MESH_INIT(name, model, shade) \
87 data->mesh_##name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ 87 data->mesh_##name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
88 eo_do(data->mesh_##name, \ 88 efl_file_set(data->mesh_##name, model, NULL); \
89 efl_file_set(model, NULL), \ 89 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_##name, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); \
90 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), \ 90 evas_canvas3d_mesh_shade_mode_set(data->mesh_##name, EVAS_CANVAS3D_SHADE_MODE_##shade); \
91 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_##shade), \ 91 evas_canvas3d_mesh_frame_material_set(data->mesh_##name, 0, data->material);
92 evas_canvas3d_mesh_frame_material_set(0, data->material));
93 92
94#define CONVEX_HULL_MESH_INIT(name) \ 93#define CONVEX_HULL_MESH_INIT(name) \
95 vert = eina_inarray_new(sizeof(float), 1); \ 94 vert = eina_inarray_new(sizeof(float), 1); \
96 ind = eina_inarray_new(sizeof(unsigned short int), 1);\ 95 ind = eina_inarray_new(sizeof(unsigned short int), 1);\
97 eo_do(data->mesh_##name, \ 96 evas_canvas3d_mesh_convex_hull_data_get(data->mesh_##name, 0, vert, ind); \
98 evas_canvas3d_mesh_convex_hull_data_get(0, vert, ind)); \
99 vertex = (float*) vert->members;\ 97 vertex = (float*) vert->members;\
100 index = ind->members;\ 98 index = ind->members;\
101 data->mesh_##name##_ch = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ 99 data->mesh_##name##_ch = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
102 eo_do(data->mesh_##name##_ch, \ 100 evas_canvas3d_mesh_vertex_count_set(data->mesh_##name##_ch, (vert->len / 10)); \
103 evas_canvas3d_mesh_vertex_count_set((vert->len / 10)), \ 101 evas_canvas3d_mesh_frame_add(data->mesh_##name##_ch, 0); \
104 evas_canvas3d_mesh_frame_add(0), \ 102 evas_canvas3d_mesh_frame_vertex_data_copy_set(data->mesh_##name##_ch, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \
105 evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \ 103 10 * sizeof(float), &vertex[ 0]); \
106 10 * sizeof(float), &vertex[ 0]), \ 104 evas_canvas3d_mesh_frame_vertex_data_copy_set(data->mesh_##name##_ch, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, \
107 evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, \ 105 10 * sizeof(float), &vertex[ 3]); \
108 10 * sizeof(float), &vertex[ 3]), \ 106 evas_canvas3d_mesh_frame_vertex_data_copy_set(data->mesh_##name##_ch, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, \
109 evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, \ 107 10 * sizeof(float), &vertex[ 6]); \
110 10 * sizeof(float), &vertex[ 6]), \ 108 evas_canvas3d_mesh_index_data_copy_set(data->mesh_##name##_ch, EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
111 evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \ 109 ind->len, &index[0]); \
112 ind->len, &index[0]), \ 110 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_##name##_ch, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES); \
113 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), \ 111 evas_canvas3d_mesh_shade_mode_set(data->mesh_##name##_ch, EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR); \
114 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR), \ 112 evas_canvas3d_mesh_frame_material_set(data->mesh_##name##_ch, 0, data->material); \
115 evas_canvas3d_mesh_frame_material_set(0, data->material)); \
116 free(vert); \ 113 free(vert); \
117 free(ind); 114 free(ind);
118 115
119#define SWITCH_MESH(index, name, scale) \ 116#define SWITCH_MESH(index, name, scale) \
120 case index: \ 117 case index: \
121 { \ 118 { \
122 eo_do(scene->mesh_node, list = evas_canvas3d_node_mesh_list_get()); \ 119 list = evas_canvas3d_node_mesh_list_get(scene->mesh_node); \
123 mesh = eina_list_nth(list, 0); \ 120 mesh = eina_list_nth(list, 0); \
124 eo_do(scene->mesh_node, \ 121 evas_canvas3d_node_mesh_del(scene->mesh_node, mesh); \
125 evas_canvas3d_node_mesh_del(mesh), \ 122 evas_canvas3d_node_mesh_add(scene->mesh_node, scene->mesh_##name); \
126 evas_canvas3d_node_mesh_add(scene->mesh_##name), \ 123 evas_canvas3d_node_scale_set(scene->mesh_node, scale, scale, scale); \
127 evas_canvas3d_node_scale_set(scale, scale, scale)); \ 124 list = evas_canvas3d_node_mesh_list_get(scene->mesh_node_convex_hull); \
128 eo_do(scene->mesh_node_convex_hull, list = evas_canvas3d_node_mesh_list_get()); \
129 mesh = eina_list_nth(list, 0); \ 125 mesh = eina_list_nth(list, 0); \
130 eo_do(scene->mesh_node_convex_hull, \ 126 evas_canvas3d_node_mesh_del(scene->mesh_node_convex_hull, mesh); \
131 evas_canvas3d_node_mesh_del(mesh), \ 127 evas_canvas3d_node_mesh_add(scene->mesh_node_convex_hull, scene->mesh_##name##_ch); \
132 evas_canvas3d_node_mesh_add(scene->mesh_##name##_ch), \ 128 evas_canvas3d_node_scale_set(scene->mesh_node_convex_hull, scale, scale, scale); \
133 evas_canvas3d_node_scale_set(scale, scale, scale)); \ 129 list = evas_canvas3d_node_mesh_list_get(scene->mesh_node_blender); \
134 eo_do(scene->mesh_node_blender, list = evas_canvas3d_node_mesh_list_get()); \
135 mesh = eina_list_nth(list, 0); \ 130 mesh = eina_list_nth(list, 0); \
136 eo_do(scene->mesh_node_blender, \ 131 evas_canvas3d_node_mesh_del(scene->mesh_node_blender, mesh); \
137 evas_canvas3d_node_mesh_del(mesh), \ 132 evas_canvas3d_node_mesh_add(scene->mesh_node_blender, scene->mesh_blender_##name); \
138 evas_canvas3d_node_mesh_add(scene->mesh_blender_##name), \ 133 evas_canvas3d_node_scale_set(scene->mesh_node_blender, scale, scale, scale); \
139 evas_canvas3d_node_scale_set(scale, scale, scale)); \
140 _print_result(scene->mesh_##name##_ch, scene->mesh_blender_test_##name); \ 134 _print_result(scene->mesh_##name##_ch, scene->mesh_blender_test_##name); \
141 break; \ 135 break; \
142 } 136 }
@@ -174,12 +168,12 @@ static void
174_print_result(Evas_Canvas3D_Mesh *mesh, Evas_Canvas3D_Mesh *convex_mesh) 168_print_result(Evas_Canvas3D_Mesh *mesh, Evas_Canvas3D_Mesh *convex_mesh)
175{ 169{
176 int v_count = 0; 170 int v_count = 0;
177 eo_do(mesh, v_count = evas_canvas3d_mesh_vertex_count_get()); 171 v_count = evas_canvas3d_mesh_vertex_count_get(mesh);
178 172
179 printf("Vertex count is %d for convex hull\n", 173 printf("Vertex count is %d for convex hull\n",
180 v_count); 174 v_count);
181 175
182 eo_do(convex_mesh, v_count = evas_canvas3d_mesh_vertex_count_get()); 176 v_count = evas_canvas3d_mesh_vertex_count_get(convex_mesh);
183 177
184 printf("Vertex count is %d for blender convex hull\n\n", 178 printf("Vertex count is %d for blender convex hull\n\n",
185 v_count); 179 v_count);
@@ -199,8 +193,8 @@ _on_canvas_resize(Ecore_Evas *ee)
199 int w, h; 193 int w, h;
200 194
201 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 195 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
202 eo_do(background, efl_gfx_size_set(w, h)); 196 efl_gfx_size_set(background, w, h);
203 eo_do(image, efl_gfx_size_set(w, h)); 197 efl_gfx_size_set(image, w, h);
204} 198}
205 199
206static Eina_Bool 200static Eina_Bool
@@ -213,14 +207,11 @@ _animate_scene(void *data)
213 if (angle >= 360.0) 207 if (angle >= 360.0)
214 angle = 0.0; 208 angle = 0.0;
215 209
216 eo_do(scene->mesh_node, 210 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 1.0, 1.0, 1.0);
217 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
218 211
219 eo_do(scene->mesh_node_convex_hull, 212 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node_convex_hull, angle, 1.0, 1.0, 1.0);
220 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
221 213
222 eo_do(scene->mesh_node_blender, 214 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node_blender, angle, 1.0, 1.0, 1.0);
223 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, 1.0));
224 215
225 return EINA_TRUE; 216 return EINA_TRUE;
226} 217}
@@ -266,38 +257,30 @@ _camera_setup(Scene_Data *data)
266{ 257{
267 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 258 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
268 259
269 eo_do(data->camera, 260 evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
270 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 2.0, 50.0));
271 261
272 data->camera_node = 262 data->camera_node =
273 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 263 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
274 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 264 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
275 eo_do(data->camera_node, 265 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
276 evas_canvas3d_node_camera_set(data->camera), 266 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
277 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 267 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
278 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
279 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
280 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node));
281} 268}
282 269
283static void 270static void
284_light_setup(Scene_Data *data) 271_light_setup(Scene_Data *data)
285{ 272{
286 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 273 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
287 eo_do(data->light, 274 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
288 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 275 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
289 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 276 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
290 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0));
291 277
292 data->light_node = 278 data->light_node =
293 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 279 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
294 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 280 evas_canvas3d_node_light_set(data->light_node, data->light);
295 eo_do(data->light_node, 281 evas_canvas3d_node_position_set(data->light_node, 0.0, 0.0, 10.0);
296 evas_canvas3d_node_light_set(data->light), 282 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
297 evas_canvas3d_node_position_set(0.0, 0.0, 10.0), 283 evas_canvas3d_node_member_add(data->root_node, data->light_node);
298 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
299 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
300 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
301} 284}
302 285
303static void 286static void
@@ -311,51 +294,41 @@ _mesh_setup(Scene_Data *data)
311 /* Setup material. */ 294 /* Setup material. */
312 295
313 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 296 data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
314 eo_do(data->material, 297 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
315 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 298 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
316 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 299 evas_canvas3d_material_enable_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
317 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 300 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0);
318 301 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0);
319 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0), 302 evas_canvas3d_material_color_set(data->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
320 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0), 303 evas_canvas3d_material_shininess_set(data->material, 100.0);
321 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
322 evas_canvas3d_material_shininess_set(100.0));
323 304
324 /* Setup mesh sphere */ 305 /* Setup mesh sphere */
325 primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 306 primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
326 eo_do(primitive, 307 evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
327 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 308 evas_canvas3d_primitive_precision_set(primitive, 10);
328 evas_canvas3d_primitive_precision_set(10));
329 data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 309 data->mesh_sphere = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
330 eo_do(data->mesh_sphere, evas_canvas3d_mesh_from_primitive_set(0, primitive)); 310 evas_canvas3d_mesh_from_primitive_set(data->mesh_sphere, 0, primitive);
331 eo_do(data->mesh_sphere, 311 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_sphere, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
332 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), 312 evas_canvas3d_mesh_shade_mode_set(data->mesh_sphere, EVAS_CANVAS3D_SHADE_MODE_PHONG);
333 313 evas_canvas3d_mesh_frame_material_set(data->mesh_sphere, 0, data->material);
334 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG),
335
336 evas_canvas3d_mesh_frame_material_set(0, data->material));
337 314
338 /* Setup mesh torus */ 315 /* Setup mesh torus */
339 data->mesh_torus = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 316 data->mesh_torus = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
340 eo_do(primitive, 317 evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_TORUS);
341 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_TORUS), 318 evas_canvas3d_primitive_precision_set(primitive, 50);
342 evas_canvas3d_primitive_precision_set(50)); 319 evas_canvas3d_mesh_from_primitive_set(data->mesh_torus, 0, primitive);
343 eo_do(data->mesh_torus, evas_canvas3d_mesh_from_primitive_set(0, primitive)); 320 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_torus, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
344 eo_do(data->mesh_torus, 321 evas_canvas3d_mesh_shade_mode_set(data->mesh_torus, EVAS_CANVAS3D_SHADE_MODE_PHONG);
345 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), 322 evas_canvas3d_mesh_frame_material_set(data->mesh_torus, 0, data->material);
346 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG),
347 evas_canvas3d_mesh_frame_material_set(0, data->material));
348 323
349 /* Setup mesh cube */ 324 /* Setup mesh cube */
350 data->mesh_cube = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 325 data->mesh_cube = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
351 eo_do(primitive, 326 evas_canvas3d_primitive_form_set(primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
352 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE), 327 evas_canvas3d_primitive_precision_set(primitive, 50);
353 evas_canvas3d_primitive_precision_set(50)); 328 evas_canvas3d_mesh_from_primitive_set(data->mesh_cube, 0, primitive);
354 eo_do(data->mesh_cube, evas_canvas3d_mesh_from_primitive_set(0, primitive)); 329 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_cube, EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
355 eo_do(data->mesh_cube, 330 evas_canvas3d_mesh_shade_mode_set(data->mesh_cube, EVAS_CANVAS3D_SHADE_MODE_PHONG);
356 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), 331 evas_canvas3d_mesh_frame_material_set(data->mesh_cube, 0, data->material);
357 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG),
358 evas_canvas3d_mesh_frame_material_set(0, data->material));
359 332
360 MODEL_MESH_INIT(plain, plain, PHONG) 333 MODEL_MESH_INIT(plain, plain, PHONG)
361 MODEL_MESH_INIT(column, column, PHONG) 334 MODEL_MESH_INIT(column, column, PHONG)
@@ -382,13 +355,11 @@ _mesh_setup(Scene_Data *data)
382 MODEL_MESH_INIT(blender_test_sonic, sonic_test, DIFFUSE) 355 MODEL_MESH_INIT(blender_test_sonic, sonic_test, DIFFUSE)
383 356
384 data->mesh_node = 357 data->mesh_node =
385 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 358 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
386 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 359 evas_canvas3d_node_member_add(data->root_node, data->mesh_node);
387 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node)); 360 evas_canvas3d_node_mesh_add(data->mesh_node, data->mesh_sphere);
388 eo_do(data->mesh_node, 361 evas_canvas3d_node_scale_set(data->mesh_node, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
389 evas_canvas3d_node_mesh_add(data->mesh_sphere), 362 evas_canvas3d_node_position_set(data->mesh_node, 3.0, 0.0, 0.0);
390 evas_canvas3d_node_scale_set(SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE),
391 evas_canvas3d_node_position_set(3.0, 0.0, 0.0));
392 363
393 CONVEX_HULL_MESH_INIT(sphere) 364 CONVEX_HULL_MESH_INIT(sphere)
394 CONVEX_HULL_MESH_INIT(torus) 365 CONVEX_HULL_MESH_INIT(torus)
@@ -402,43 +373,36 @@ _mesh_setup(Scene_Data *data)
402 _print_result(data->mesh_sphere_ch, data->mesh_blender_test_sphere); 373 _print_result(data->mesh_sphere_ch, data->mesh_blender_test_sphere);
403 374
404 data->mesh_node_convex_hull = 375 data->mesh_node_convex_hull =
405 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 376 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
406 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 377 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_convex_hull);
407 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node_convex_hull)); 378 evas_canvas3d_node_position_set(data->mesh_node_convex_hull, 0.0, 0.0, 0.0);
408 eo_do(data->mesh_node_convex_hull, 379 evas_canvas3d_node_scale_set(data->mesh_node_convex_hull, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
409 evas_canvas3d_node_position_set(0.0, 0.0, 0.0), 380 evas_canvas3d_node_mesh_add(data->mesh_node_convex_hull, data->mesh_sphere_ch);
410 evas_canvas3d_node_scale_set(SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE),
411 evas_canvas3d_node_mesh_add(data->mesh_sphere_ch));
412 381
413 data->mesh_node_blender = 382 data->mesh_node_blender =
414 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 383 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
415 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); 384 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_blender);
416 eo_do(data->root_node, evas_canvas3d_node_member_add(data->mesh_node_blender)); 385 evas_canvas3d_node_position_set(data->mesh_node_blender, -3.0, 0.0, 0.0);
417 eo_do(data->mesh_node_blender, 386 evas_canvas3d_node_scale_set(data->mesh_node_blender, SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE);
418 evas_canvas3d_node_position_set(-3.0, 0.0, 0.0), 387 evas_canvas3d_node_mesh_add(data->mesh_node_blender, data->mesh_blender_sphere);
419 evas_canvas3d_node_scale_set(SCALE_SPHERE, SCALE_SPHERE, SCALE_SPHERE),
420 evas_canvas3d_node_mesh_add(data->mesh_blender_sphere));
421} 388}
422 389
423static void 390static void
424_scene_setup(Scene_Data *data) 391_scene_setup(Scene_Data *data)
425{ 392{
426 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 393 data->scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
427 eo_do(data->scene, 394 evas_canvas3d_scene_size_set(data->scene, WIDTH, HEIGHT);
428 evas_canvas3d_scene_size_set(WIDTH, HEIGHT); 395 evas_canvas3d_scene_background_color_set(data->scene, 0.0, 0.0, 0.0, 0.0);
429 evas_canvas3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0));
430 396
431 data->root_node = 397 data->root_node =
432 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 398 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
433 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
434 399
435 _camera_setup(data); 400 _camera_setup(data);
436 _light_setup(data); 401 _light_setup(data);
437 _mesh_setup(data); 402 _mesh_setup(data);
438 403
439 eo_do(data->scene, 404 evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
440 evas_canvas3d_scene_root_node_set(data->root_node), 405 evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
441 evas_canvas3d_scene_camera_node_set(data->camera_node));
442} 406}
443 407
444int 408int
@@ -468,22 +432,20 @@ main(void)
468 432
469 /* Add a background rectangle objects. */ 433 /* Add a background rectangle objects. */
470 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 434 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
471 eo_do(background, 435 efl_gfx_color_set(background, 0, 0, 0, 255);
472 efl_gfx_color_set(0, 0, 0, 255), 436 efl_gfx_size_set(background, WIDTH, HEIGHT);
473 efl_gfx_size_set(WIDTH, HEIGHT), 437 efl_gfx_visible_set(background, EINA_TRUE);
474 efl_gfx_visible_set(EINA_TRUE));
475 438
476 /* Add an image object for 3D scene rendering. */ 439 /* Add an image object for 3D scene rendering. */
477 image = evas_object_image_filled_add(evas); 440 image = evas_object_image_filled_add(evas);
478 eo_do(image, 441 efl_gfx_size_set(image, WIDTH, HEIGHT);
479 efl_gfx_size_set(WIDTH, HEIGHT), 442 efl_gfx_visible_set(image, EINA_TRUE);
480 efl_gfx_visible_set(EINA_TRUE));
481 443
482 evas_object_show(image), 444 evas_object_show(image),
483 evas_object_focus_set(image, EINA_TRUE); 445 evas_object_focus_set(image, EINA_TRUE);
484 446
485 /* Set the image object as render target for 3D scene. */ 447 /* Set the image object as render target for 3D scene. */
486 eo_do(image, evas_obj_image_scene_set(data.scene)); 448 evas_obj_image_scene_set(image, data.scene);
487 449
488 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _key_down, &data); 450 evas_object_event_callback_add(image, EVAS_CALLBACK_KEY_DOWN, _key_down, &data);
489 451
diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c
index 9409efc..e19dfd6 100644
--- a/src/examples/evas/evas-3d-md2.c
+++ b/src/examples/evas/evas-3d-md2.c
@@ -47,7 +47,7 @@ _animate_scene(void *data)
47{ 47{
48 static int frame = 0; 48 static int frame = 0;
49 49
50 eo_do((Evas_Canvas3D_Node *)data, evas_canvas3d_node_mesh_frame_set(mesh, frame)); 50 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh, frame);
51 51
52 frame += 32; 52 frame += 32;
53 53
@@ -68,8 +68,8 @@ _on_canvas_resize(Ecore_Evas *ee)
68 int w, h; 68 int w, h;
69 69
70 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 70 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
71 eo_do(background, efl_gfx_size_set(w, h)); 71 efl_gfx_size_set(background, w, h);
72 eo_do(image, efl_gfx_size_set(w, h)); 72 efl_gfx_size_set(image, w, h);
73} 73}
74 74
75int 75int
@@ -94,102 +94,76 @@ main(void)
94 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 94 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
95 95
96 /* Add the root node for the scene. */ 96 /* Add the root node for the scene. */
97 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 97 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
98 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
99 98
100 /* Add the camera. */ 99 /* Add the camera. */
101 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 100 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
102 eo_do(camera, 101 evas_canvas3d_camera_projection_perspective_set(camera, 60.0, 1.0, 1.0, 500.0);
103 evas_canvas3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0));
104 102
105 camera_node = 103 camera_node =
106 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 104 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
107 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 105 evas_canvas3d_node_camera_set(camera_node, camera);
108 eo_do(camera_node, 106 evas_canvas3d_node_member_add(root_node, camera_node);
109 evas_canvas3d_node_camera_set(camera)); 107 evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 20.0);
110 eo_do(root_node, 108 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
111 evas_canvas3d_node_member_add(camera_node));
112 eo_do(camera_node,
113 evas_canvas3d_node_position_set(100.0, 0.0, 20.0),
114 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 20.0,
115 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
116 /* Add the light. */ 109 /* Add the light. */
117 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 110 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
118 eo_do(light, 111 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
119 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 112 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
120 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 113 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
121 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 114 evas_canvas3d_light_directional_set(light, EINA_TRUE);
122 evas_canvas3d_light_directional_set(EINA_TRUE));
123 115
124 light_node = 116 light_node =
125 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 117 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
126 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 118 evas_canvas3d_node_light_set(light_node, light);
127 eo_do(light_node, 119 evas_canvas3d_node_position_set(light_node, 1000.0, 0.0, 1000.0);
128 evas_canvas3d_node_light_set(light), 120 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
129 evas_canvas3d_node_position_set(1000.0, 0.0, 1000.0), 121 evas_canvas3d_node_member_add(root_node, light_node);
130 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
131 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
132 eo_do(root_node,
133 evas_canvas3d_node_member_add(light_node));
134 122
135 /* Add the mesh. */ 123 /* Add the mesh. */
136 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 124 mesh = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
137 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 125 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
138 126
139 eo_do(mesh, 127 efl_file_set(mesh, model_path, NULL);
140 efl_file_set(model_path, NULL), 128 evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
141 evas_canvas3d_mesh_frame_material_set(0, material), 129 evas_canvas3d_mesh_shade_mode_set(mesh, EVAS_CANVAS3D_SHADE_MODE_PHONG);
142 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
143 130
144 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 131 texture = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
145 eo_do(texture, 132 evas_canvas3d_texture_file_set(texture, image_path, NULL);
146 evas_canvas3d_texture_file_set(image_path, NULL), 133 evas_canvas3d_texture_filter_set(texture, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
147 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 134 evas_canvas3d_texture_wrap_set(texture, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
148 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), 135 evas_canvas3d_material_texture_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture);
149 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 136 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
150 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 137 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
151 eo_do(material, 138 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
152 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture), 139 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
153 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 140 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
154 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 141 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
155 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 142 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
156 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 143 evas_canvas3d_material_shininess_set(material, 50.0);
157 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 144
158 0.01, 0.01, 0.01, 1.0), 145 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
159 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 146 evas_canvas3d_node_member_add(root_node, mesh_node);
160 1.0, 1.0, 1.0, 1.0), 147 evas_canvas3d_node_mesh_add(mesh_node, mesh);
161 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
162 1.0, 1.0, 1.0, 1.0),
163 evas_canvas3d_material_shininess_set(50.0));
164
165 mesh_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
166 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
167 eo_do(root_node,
168 evas_canvas3d_node_member_add(mesh_node));
169 eo_do(mesh_node,
170 evas_canvas3d_node_mesh_add(mesh));
171 148
172 /* Set up scene. */ 149 /* Set up scene. */
173 eo_do(scene, 150 evas_canvas3d_scene_root_node_set(scene, root_node);
174 evas_canvas3d_scene_root_node_set(root_node), 151 evas_canvas3d_scene_camera_node_set(scene, camera_node);
175 evas_canvas3d_scene_camera_node_set(camera_node), 152 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
176 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
177 153
178 /* Add a background rectangle objects. */ 154 /* Add a background rectangle objects. */
179 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 155 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
180 eo_do(background, 156 efl_gfx_color_set(background, 0, 0, 0, 255);
181 efl_gfx_color_set(0, 0, 0, 255), 157 efl_gfx_size_set(background, WIDTH, HEIGHT);
182 efl_gfx_size_set(WIDTH, HEIGHT), 158 efl_gfx_visible_set(background, EINA_TRUE);
183 efl_gfx_visible_set(EINA_TRUE));
184 159
185 /* Add an image object for 3D scene rendering. */ 160 /* Add an image object for 3D scene rendering. */
186 image = evas_object_image_filled_add(evas); 161 image = evas_object_image_filled_add(evas);
187 eo_do(image, 162 efl_gfx_size_set(image, WIDTH, HEIGHT);
188 efl_gfx_size_set(WIDTH, HEIGHT), 163 efl_gfx_visible_set(image, EINA_TRUE);
189 efl_gfx_visible_set(EINA_TRUE));
190 164
191 /* Set the image object as render target for 3D scene. */ 165 /* Set the image object as render target for 3D scene. */
192 eo_do(image, evas_obj_image_scene_set(scene)); 166 evas_obj_image_scene_set(image, scene);
193 167
194 ecore_timer_add(0.01, _animate_scene, mesh_node); 168 ecore_timer_add(0.01, _animate_scene, mesh_node);
195 169
diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c
index 39f6d34..000204d 100644
--- a/src/examples/evas/evas-3d-mmap-set.c
+++ b/src/examples/evas/evas-3d-mmap-set.c
@@ -33,24 +33,22 @@
33 snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \ 33 snprintf(buffer, PATH_MAX, "%s%s", template_path, #extention); \
34 extention##_file = eina_file_open(buffer , 0); \ 34 extention##_file = eina_file_open(buffer , 0); \
35 mesh_##extention = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ 35 mesh_##extention = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
36 eo_do(mesh_##extention, \ 36 efl_file_mmap_set(mesh_##extention, extention##_file, NULL); \
37 efl_file_mmap_set(extention##_file, NULL), \ 37 evas_canvas3d_mesh_frame_material_set(mesh_##extention, 0, material); \
38 evas_canvas3d_mesh_frame_material_set(0, material), \ 38 evas_canvas3d_mesh_shade_mode_set(mesh_##extention, EVAS_CANVAS3D_SHADE_MODE_PHONG); \
39 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG)); \ 39 node_##extention = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
40 node_##extention = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, \ 40 evas_canvas3d_node_member_add(root_node, node_##extention); \
41 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); \ 41 evas_canvas3d_node_mesh_add(node_##extention, mesh_##extention); \
42 eo_do(root_node, evas_canvas3d_node_member_add(node_##extention)); \ 42 evas_canvas3d_node_position_set(node_##extention, initial_node_data[number * 10], \
43 eo_do(node_##extention, evas_canvas3d_node_mesh_add(mesh_##extention), \ 43 initial_node_data[number * 10 + 1], \
44 evas_canvas3d_node_position_set(initial_node_data[number * 10], \ 44 initial_node_data[number * 10 + 2]); \
45 initial_node_data[number * 10 + 1], \ 45 evas_canvas3d_node_scale_set(node_##extention, initial_node_data[number * 10 + 3], \
46 initial_node_data[number * 10 + 2]), \ 46 initial_node_data[number * 10 + 4], \
47 evas_canvas3d_node_scale_set(initial_node_data[number * 10 + 3], \ 47 initial_node_data[number * 10 + 5]); \
48 initial_node_data[number * 10 + 4], \ 48 evas_canvas3d_node_orientation_angle_axis_set(node_##extention, initial_node_data[number * 10 + 6], \
49 initial_node_data[number * 10 + 5]), \ 49 initial_node_data[number * 10 + 7], \
50 evas_canvas3d_node_orientation_angle_axis_set(initial_node_data[number * 10 + 6], \ 50 initial_node_data[number * 10 + 8], \
51 initial_node_data[number * 10 + 7], \ 51 initial_node_data[number * 10 + 9]);\
52 initial_node_data[number * 10 + 8], \
53 initial_node_data[number * 10 + 9]));\
54 ecore_timer_add(0.01, _animate_##extention, node_##extention); 52 ecore_timer_add(0.01, _animate_##extention, node_##extention);
55 53
56static const char *template_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "/mesh_for_mmap."; 54static const char *template_path = PACKAGE_EXAMPLES_DIR EVAS_MODEL_FOLDER "/mesh_for_mmap.";
@@ -100,9 +98,8 @@ _animate_obj(void *data)
100 obj_animation_parameter += obj_animation_velocity; 98 obj_animation_parameter += obj_animation_velocity;
101 float oap = obj_animation_parameter/200; 99 float oap = obj_animation_parameter/200;
102 100
103 eo_do((Evas_Canvas3D_Node *)data, 101 evas_canvas3d_node_scale_set((Evas_Canvas3D_Node *)data, oap, oap, oap);
104 evas_canvas3d_node_scale_set(oap, oap, oap), 102 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, obj_animation_parameter, 0.0, 1.0, 0.0);
105 evas_canvas3d_node_orientation_angle_axis_set(obj_animation_parameter, 0.0, 1.0, 0.0));
106 103
107 if (obj_animation_parameter >= 360.0 || obj_animation_parameter <= 0.0) 104 if (obj_animation_parameter >= 360.0 || obj_animation_parameter <= 0.0)
108 obj_animation_velocity *= -1.0; 105 obj_animation_velocity *= -1.0;
@@ -115,8 +112,7 @@ _animate_eet(void *data)
115{ 112{
116 eet_animation_parameter += eet_animation_velocity; 113 eet_animation_parameter += eet_animation_velocity;
117 114
118 eo_do((Evas_Canvas3D_Node *)data, 115 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, eet_animation_parameter, 1.0, 0.0, 0.0);
119 evas_canvas3d_node_orientation_angle_axis_set(eet_animation_parameter, 1.0, 0.0, 0.0));
120 eet_animation_velocity = sin(eet_animation_parameter / 180 * M_PI) + 1.1; 116 eet_animation_velocity = sin(eet_animation_parameter / 180 * M_PI) + 1.1;
121 117
122 return EINA_TRUE; 118 return EINA_TRUE;
@@ -127,8 +123,7 @@ _animate_ply(void *data)
127{ 123{
128 ply_animation_parameter += ply_animation_velocity; 124 ply_animation_parameter += ply_animation_velocity;
129 125
130 eo_do((Evas_Canvas3D_Node *)data, 126 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, ply_animation_parameter, 1.0, 0.0, 0.0);
131 evas_canvas3d_node_orientation_angle_axis_set(ply_animation_parameter, 1.0, 0.0, 0.0));
132 127
133 if (ply_animation_parameter > 360.0) ply_animation_parameter -= 180.0f; 128 if (ply_animation_parameter > 360.0) ply_animation_parameter -= 180.0f;
134 129
@@ -140,8 +135,7 @@ _animate_md2(void *data)
140{ 135{
141 md2_animation_parameter += md2_animation_velocity; 136 md2_animation_parameter += md2_animation_velocity;
142 137
143 eo_do((Evas_Canvas3D_Node *)data, 138 evas_canvas3d_node_mesh_frame_set((Evas_Canvas3D_Node *)data, mesh_md2, md2_animation_parameter);
144 evas_canvas3d_node_mesh_frame_set(mesh_md2, md2_animation_parameter));
145 139
146 if (md2_animation_parameter >= 360.0 || md2_animation_parameter <= 0.0) 140 if (md2_animation_parameter >= 360.0 || md2_animation_parameter <= 0.0)
147 md2_animation_velocity *= -1.0; 141 md2_animation_velocity *= -1.0;
@@ -161,8 +155,8 @@ _on_canvas_resize(Ecore_Evas *ee)
161 int w, h; 155 int w, h;
162 156
163 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 157 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
164 eo_do(background, efl_gfx_size_set(w, h)); 158 efl_gfx_size_set(background, w, h);
165 eo_do(image, efl_gfx_size_set(w, h)); 159 efl_gfx_size_set(image, w, h);
166} 160}
167 161
168int 162int
@@ -190,58 +184,42 @@ main(void)
190 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 184 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
191 185
192 /* Add the root node for the scene. */ 186 /* Add the root node for the scene. */
193 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 187 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
194 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
195 188
196 /* Add the camera. */ 189 /* Add the camera. */
197 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 190 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
198 eo_do(camera, 191 evas_canvas3d_camera_projection_perspective_set(camera, 10.0, 1.0, 1.0, 500.0);
199 evas_canvas3d_camera_projection_perspective_set(10.0, 1.0, 1.0, 500.0));
200 192
201 camera_node = 193 camera_node =
202 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 194 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
203 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 195 evas_canvas3d_node_camera_set(camera_node, camera);
204 eo_do(camera_node, 196 evas_canvas3d_node_member_add(root_node, camera_node);
205 evas_canvas3d_node_camera_set(camera)); 197 evas_canvas3d_node_position_set(camera_node, 0.0, 0.0, 100.0);
206 eo_do(root_node, 198 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
207 evas_canvas3d_node_member_add(camera_node));
208 eo_do(camera_node,
209 evas_canvas3d_node_position_set(0.0, 0.0, 100.0),
210 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
211 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
212 /* Add the light. */ 199 /* Add the light. */
213 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 200 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
214 eo_do(light, 201 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
215 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 202 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
216 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 203 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
217 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 204 evas_canvas3d_light_directional_set(light, EINA_TRUE);
218 evas_canvas3d_light_directional_set(EINA_TRUE));
219 205
220 light_node = 206 light_node =
221 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 207 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
222 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 208 evas_canvas3d_node_light_set(light_node, light);
223 eo_do(light_node, 209 evas_canvas3d_node_position_set(light_node, 1.0, 0.0, 100.0);
224 evas_canvas3d_node_light_set(light), 210 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
225 evas_canvas3d_node_position_set(1.0, 0.0, 100.0), 211 evas_canvas3d_node_member_add(root_node, light_node);
226 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
227 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
228 eo_do(root_node,
229 evas_canvas3d_node_member_add(light_node));
230 212
231 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 213 material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
232 214
233 eo_do(material, 215 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
234 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 216 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
235 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 217 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
236 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 218 evas_canvas3d_material_enable_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
237 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 219 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0);
238 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 220 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 0.0, 1.0);
239 0.01, 0.01, 0.01, 1.0), 221 evas_canvas3d_material_color_set(material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.0, 1.0, 1.0);
240 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 222 evas_canvas3d_material_shininess_set(material, 50.0);
241 1.0, 1.0, 0.0, 1.0),
242 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
243 0.5, 0.0, 1.0, 1.0),
244 evas_canvas3d_material_shininess_set(50.0));
245 223
246 /* Add the meshes */ 224 /* Add the meshes */
247 LOAD_AND_ADD_MESH(obj, 0); 225 LOAD_AND_ADD_MESH(obj, 0);
@@ -250,26 +228,23 @@ main(void)
250 LOAD_AND_ADD_MESH(md2, 3); 228 LOAD_AND_ADD_MESH(md2, 3);
251 229
252 /* Set up scene. */ 230 /* Set up scene. */
253 eo_do(scene, 231 evas_canvas3d_scene_root_node_set(scene, root_node);
254 evas_canvas3d_scene_root_node_set(root_node), 232 evas_canvas3d_scene_camera_node_set(scene, camera_node);
255 evas_canvas3d_scene_camera_node_set(camera_node), 233 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
256 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
257 234
258 /* Add a background rectangle objects. */ 235 /* Add a background rectangle objects. */
259 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 236 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
260 eo_do(background, 237 efl_gfx_color_set(background, 20, 20, 200, 255);
261 efl_gfx_color_set(20, 20, 200, 255), 238 efl_gfx_size_set(background, WIDTH, HEIGHT);
262 efl_gfx_size_set(WIDTH, HEIGHT), 239 efl_gfx_visible_set(background, EINA_TRUE);
263 efl_gfx_visible_set(EINA_TRUE));
264 240
265 /* Add an image object for 3D scene rendering. */ 241 /* Add an image object for 3D scene rendering. */
266 image = evas_object_image_filled_add(evas); 242 image = evas_object_image_filled_add(evas);
267 eo_do(image, 243 efl_gfx_size_set(image, WIDTH, HEIGHT);
268 efl_gfx_size_set(WIDTH, HEIGHT), 244 efl_gfx_visible_set(image, EINA_TRUE);
269 efl_gfx_visible_set(EINA_TRUE));
270 245
271 /* Set the image object as render target for 3D scene. */ 246 /* Set the image object as render target for 3D scene. */
272 eo_do(image, evas_obj_image_scene_set(scene)); 247 evas_obj_image_scene_set(image, scene);
273 248
274 /* Enter main loop. */ 249 /* Enter main loop. */
275 ecore_main_loop_begin(); 250 ecore_main_loop_begin();
diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c
index 0d40a41..b9a6b69 100644
--- a/src/examples/evas/evas-3d-obj.c
+++ b/src/examples/evas/evas-3d-obj.c
@@ -46,49 +46,43 @@
46#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \ 46#define ADD_OBJ_MESH(path, Y, Z, num, shade_mode, name_of_material) \
47 mesh[num] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \ 47 mesh[num] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); \
48 snprintf(full_file_path, PATH_MAX, "%s%s", path, ".obj"); \ 48 snprintf(full_file_path, PATH_MAX, "%s%s", path, ".obj"); \
49 eo_do(mesh[num], \ 49 efl_file_set(mesh[num], full_file_path, NULL); \
50 efl_file_set(full_file_path, NULL), \ 50 evas_canvas3d_mesh_frame_material_set(mesh[num], 0, name_of_material); \
51 evas_canvas3d_mesh_frame_material_set(0, name_of_material), \ 51 evas_canvas3d_mesh_shade_mode_set(mesh[num], shade_mode); \
52 evas_canvas3d_mesh_shade_mode_set(shade_mode)); \ 52 mesh_node[num] = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH)); \
53 mesh_node[num] = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, \ 53 evas_canvas3d_node_member_add(root_node, mesh_node[num]); \
54 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH)); \ 54 evas_canvas3d_node_mesh_add(mesh_node[num], mesh[num]); \
55 eo_do(root_node, \ 55 evas_canvas3d_node_position_set(mesh_node[num], 0, Y, Z); \
56 evas_canvas3d_node_member_add(mesh_node[num])); \
57 eo_do(mesh_node[num], \
58 evas_canvas3d_node_mesh_add(mesh[num]), \
59 evas_canvas3d_node_position_set(0, Y, Z)); \
60 56
61#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material)\ 57#define ADD_OBJ_MESH_AND_SAVED_COPY(path, Y, Z, num, shade_mode, name_of_material)\
62 snprintf(buffer, PATH_MAX, "%s%s", input_template, #path); \ 58 snprintf(buffer, PATH_MAX, "%s%s", input_template, #path); \
63 ADD_OBJ_MESH(buffer, Y, Z, num, shade_mode, name_of_material) \ 59 ADD_OBJ_MESH(buffer, Y, Z, num, shade_mode, name_of_material) \
64 snprintf(buffer, PATH_MAX, "%s%s%s", output_template, #path, ".obj"); \ 60 snprintf(buffer, PATH_MAX, "%s%s%s", output_template, #path, ".obj"); \
65 eo_do(mesh[num], efl_file_save(buffer, NULL, NULL)); \ 61 efl_file_save(mesh[num], buffer, NULL, NULL); \
66 snprintf(buffer, PATH_MAX, "%s%s", output_template, #path); \ 62 snprintf(buffer, PATH_MAX, "%s%s", output_template, #path); \
67 ADD_OBJ_MESH(buffer, Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material) 63 ADD_OBJ_MESH(buffer, Y + COPY_OFFSET, Z, num + 4, shade_mode, name_of_material)
68 64
69#define ADD_TEXTURE(name, path) \ 65#define ADD_TEXTURE(name, path) \
70 name = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \ 66 name = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
71 eo_do(name, \ 67 evas_canvas3d_texture_file_set(name, path, NULL); \
72 evas_canvas3d_texture_file_set(path, NULL), \ 68 evas_canvas3d_texture_filter_set(name, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \
73 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, \ 69 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST); \
74 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST), \ 70 evas_canvas3d_texture_wrap_set(name, EVAS_CANVAS3D_WRAP_MODE_REPEAT, \
75 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, \ 71 EVAS_CANVAS3D_WRAP_MODE_REPEAT);
76 EVAS_CANVAS3D_WRAP_MODE_REPEAT));
77 72
78#define ADD_MATERIAL(name) \ 73#define ADD_MATERIAL(name) \
79 name = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \ 74 name = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
80 eo_do(name, \ 75 evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE); \
81 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), \ 76 evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE); \
82 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), \ 77 evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE); \
83 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),\ 78 evas_canvas3d_material_enable_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE); \
84 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), \ 79 evas_canvas3d_material_color_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, \
85 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, \ 80 COL_RED, 0.5); \
86 COL_RED, 0.5), \ 81 evas_canvas3d_material_color_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, \
87 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, \ 82 COL_GREEN, 0.5); \
88 COL_GREEN, 0.5), \ 83 evas_canvas3d_material_color_set(name, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, \
89 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, \ 84 COL_BLUE, 0.5); \
90 COL_BLUE, 0.5), \ 85 evas_canvas3d_material_shininess_set(name, 100.0);
91 evas_canvas3d_material_shininess_set(100.0));
92 86
93static const char *texture_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/sweet_home_reversed.png"; 87static const char *texture_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/sweet_home_reversed.png";
94static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES "/saved_"; 88static const char *output_template = PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES "/saved_";
@@ -118,8 +112,7 @@ _animate_scene(void *data)
118{ 112{
119 angle += 0.2; 113 angle += 0.2;
120 114
121 eo_do((Evas_Canvas3D_Node *)data, 115 evas_canvas3d_node_orientation_angle_axis_set((Evas_Canvas3D_Node *)data, angle, 1.0, 1.0, -1.0);
122 evas_canvas3d_node_orientation_angle_axis_set(angle, 1.0, 1.0, -1.0));
123 116
124 /* Rotate */ 117 /* Rotate */
125 if (angle > 360.0) angle -= 360.0f; 118 if (angle > 360.0) angle -= 360.0f;
@@ -139,8 +132,8 @@ _on_canvas_resize(Ecore_Evas *ee)
139 int w, h; 132 int w, h;
140 133
141 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 134 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
142 eo_do(background, efl_gfx_size_set(w, h)); 135 efl_gfx_size_set(background, w, h);
143 eo_do(image, efl_gfx_size_set(w, h)); 136 efl_gfx_size_set(image, w, h);
144} 137}
145 138
146int 139int
@@ -167,51 +160,38 @@ main(void)
167 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 160 scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
168 161
169 /* Add the root node for the scene. */ 162 /* Add the root node for the scene. */
170 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 163 root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
171 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
172 164
173 /* Add the camera. */ 165 /* Add the camera. */
174 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 166 camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
175 eo_do(camera, 167 evas_canvas3d_camera_projection_perspective_set(camera, 20.0, 1.0, 1.0, 500.0);
176 evas_canvas3d_camera_projection_perspective_set(20.0, 1.0, 1.0, 500.0));
177 168
178 camera_node = 169 camera_node =
179 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 170 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
180 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 171 evas_canvas3d_node_camera_set(camera_node, camera);
181 eo_do(camera_node, 172 evas_canvas3d_node_member_add(root_node, camera_node);
182 evas_canvas3d_node_camera_set(camera)); 173 evas_canvas3d_node_position_set(camera_node, 100.0, 0.0, 0.0);
183 eo_do(root_node, 174 evas_canvas3d_node_look_at_set(camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0);
184 evas_canvas3d_node_member_add(camera_node));
185 eo_do(camera_node,
186 evas_canvas3d_node_position_set(100.0, 0.0, 0.0),
187 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
188 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 1.0));
189 /* Add the light. */ 175 /* Add the light. */
190 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 176 light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
191 eo_do(light, 177 evas_canvas3d_light_ambient_set(light, 1.0, 1.0, 1.0, 1.0);
192 evas_canvas3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), 178 evas_canvas3d_light_diffuse_set(light, 1.0, 1.0, 1.0, 1.0);
193 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 179 evas_canvas3d_light_specular_set(light, 1.0, 1.0, 1.0, 1.0);
194 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0), 180 evas_canvas3d_light_directional_set(light, EINA_TRUE);
195 evas_canvas3d_light_directional_set(EINA_TRUE));
196 181
197 light_node = 182 light_node =
198 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 183 eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
199 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 184 evas_canvas3d_node_light_set(light_node, light);
200 eo_do(light_node, 185 evas_canvas3d_node_position_set(light_node, 10.0, 0.0, 0.0);
201 evas_canvas3d_node_light_set(light), 186 evas_canvas3d_node_look_at_set(light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
202 evas_canvas3d_node_position_set(10.0, 0.0, 0.0), 187 evas_canvas3d_node_member_add(root_node, light_node);
203 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
204 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
205 eo_do(root_node,
206 evas_canvas3d_node_member_add(light_node));
207 188
208 ADD_TEXTURE(texture, texture_path) 189 ADD_TEXTURE(texture, texture_path)
209 190
210 ADD_MATERIAL(material) 191 ADD_MATERIAL(material)
211 192
212 ADD_MATERIAL(material_with_tex) 193 ADD_MATERIAL(material_with_tex)
213 eo_do(material_with_tex, 194 evas_canvas3d_material_texture_set(material_with_tex, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture);
214 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture));
215 195
216 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES)) 196 if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES))
217 fprintf(stderr, "Failed to create folder %s\n\n", 197 fprintf(stderr, "Failed to create folder %s\n\n",
@@ -227,26 +207,23 @@ main(void)
227 EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER, NULL) 207 EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER, NULL)
228 208
229 /* Set up scene. */ 209 /* Set up scene. */
230 eo_do(scene, 210 evas_canvas3d_scene_root_node_set(scene, root_node);
231 evas_canvas3d_scene_root_node_set(root_node), 211 evas_canvas3d_scene_camera_node_set(scene, camera_node);
232 evas_canvas3d_scene_camera_node_set(camera_node), 212 evas_canvas3d_scene_size_set(scene, WIDTH, HEIGHT);
233 evas_canvas3d_scene_size_set(WIDTH, HEIGHT));
234 213
235 /* Add a background rectangle MESHES. */ 214 /* Add a background rectangle MESHES. */
236 background = eo_add(EVAS_RECTANGLE_CLASS, evas); 215 background = eo_add(EVAS_RECTANGLE_CLASS, evas);
237 eo_do(background, 216 efl_gfx_color_set(background, 0, 0, 0, 255);
238 efl_gfx_color_set(0, 0, 0, 255), 217 efl_gfx_size_set(background, WIDTH, HEIGHT);
239 efl_gfx_size_set(WIDTH, HEIGHT), 218 efl_gfx_visible_set(background, EINA_TRUE);
240 efl_gfx_visible_set(EINA_TRUE));
241 219
242 /* Add an image object for 3D scene rendering. */ 220 /* Add an image object for 3D scene rendering. */
243 image = evas_object_image_filled_add(evas); 221 image = evas_object_image_filled_add(evas);
244 eo_do(image, 222 efl_gfx_size_set(image, WIDTH, HEIGHT);
245 efl_gfx_size_set(WIDTH, HEIGHT), 223 efl_gfx_visible_set(image, EINA_TRUE);
246 efl_gfx_visible_set(EINA_TRUE));
247 224
248 /* Set the image object as render target for 3D scene. */ 225 /* Set the image object as render target for 3D scene. */
249 eo_do(image, evas_obj_image_scene_set(scene)); 226 evas_obj_image_scene_set(image, scene);
250 227
251 for (i = 0; i < NUMBER_OF_MESHES; i++) 228 for (i = 0; i < NUMBER_OF_MESHES; i++)
252 ecore_timer_add(ANIM_SPEED, _animate_scene, mesh_node[i]); 229 ecore_timer_add(ANIM_SPEED, _animate_scene, mesh_node[i]);
diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c
index fd1e8ce..ff20dfe 100644
--- a/src/examples/evas/evas-3d-parallax-occlusion.c
+++ b/src/examples/evas/evas-3d-parallax-occlusion.c
@@ -62,10 +62,10 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
62 Evas_Event_Key_Down *ev = event_info; 62 Evas_Event_Key_Down *ev = event_info;
63 63
64 if (!strcmp("n", ev->key)) 64 if (!strcmp("n", ev->key))
65 eo_do(scene->mesh, evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP)); 65 evas_canvas3d_mesh_shade_mode_set(scene->mesh, EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP);
66 66
67 if (!strcmp("p", ev->key)) 67 if (!strcmp("p", ev->key))
68 eo_do(scene->mesh, evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION)); 68 evas_canvas3d_mesh_shade_mode_set(scene->mesh, EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION);
69} 69}
70 70
71static void 71static void
@@ -80,8 +80,8 @@ _on_canvas_resize(Ecore_Evas *ee)
80 int w, h; 80 int w, h;
81 81
82 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); 82 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
83 eo_do(background, efl_gfx_size_set(w, h)); 83 efl_gfx_size_set(background, w, h);
84 eo_do(image, efl_gfx_size_set(w, h)); 84 efl_gfx_size_set(image, w, h);
85} 85}
86 86
87static Eina_Bool 87static Eina_Bool
@@ -92,10 +92,9 @@ _animate_scene(void *data)
92 92
93 angle += 0.5; 93 angle += 0.5;
94 94
95 eo_do(scene->mesh_node, 95 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node, angle, 0.0, 1.0, 0.0);
96 evas_canvas3d_node_orientation_angle_axis_set(angle, 0.0, 1.0, 0.0));
97 96
98 eo_do(scene->mesh_node, evas_canvas3d_node_mesh_frame_set(scene->mesh, 50 * (1 + sin(angle / 180.0 * M_PI)))); 97 evas_canvas3d_node_mesh_frame_set(scene->mesh_node, scene->mesh, 50 * (1 + sin(angle / 180.0 * M_PI)));
99 /* Rotate */ 98 /* Rotate */
100 if (angle > 360.0) angle = 0.0f; 99 if (angle > 360.0) angle = 0.0f;
101 100
@@ -107,36 +106,28 @@ _camera_setup(Scene_Data *data)
107{ 106{
108 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas); 107 data->camera = eo_add(EVAS_CANVAS3D_CAMERA_CLASS, evas);
109 108
110 eo_do(data->camera, 109 evas_canvas3d_camera_projection_perspective_set(data->camera, 30.0, 1.0, 2.0, 50.0);
111 evas_canvas3d_camera_projection_perspective_set(30.0, 1.0, 2.0, 50.0)); 110
112 111 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
113 data->camera_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 112 evas_canvas3d_node_camera_set(data->camera_node, data->camera);
114 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_CAMERA)); 113 evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
115 eo_do(data->camera_node, 114 evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
116 evas_canvas3d_node_camera_set(data->camera), 115 evas_canvas3d_node_member_add(data->root_node, data->camera_node);
117 evas_canvas3d_node_position_set(0.0, 0.0, 10.0),
118 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
119 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
120 eo_do(data->root_node, evas_canvas3d_node_member_add(data->camera_node));
121} 116}
122 117
123static void 118static void
124_light_setup(Scene_Data *data) 119_light_setup(Scene_Data *data)
125{ 120{
126 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas); 121 data->light = eo_add(EVAS_CANVAS3D_LIGHT_CLASS, evas);
127 eo_do(data->light, 122 evas_canvas3d_light_ambient_set(data->light, 0.2, 0.2, 0.2, 1.0);
128 evas_canvas3d_light_ambient_set(0.2, 0.2, 0.2, 1.0), 123 evas_canvas3d_light_diffuse_set(data->light, 1.0, 1.0, 1.0, 1.0);
129 evas_canvas3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), 124 evas_canvas3d_light_specular_set(data->light, 1.0, 1.0, 1.0, 1.0);
130 evas_canvas3d_light_specular_set(1.0, 1.0, 1.0, 1.0)); 125
131 126 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_LIGHT));
132 data->light_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 127 evas_canvas3d_node_light_set(data->light_node, data->light);
133 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_LIGHT)); 128 evas_canvas3d_node_position_set(data->light_node, -20.0, 20.0, 50.0);
134 eo_do(data->light_node, 129 evas_canvas3d_node_look_at_set(data->light_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
135 evas_canvas3d_node_light_set(data->light), 130 evas_canvas3d_node_member_add(data->root_node, data->light_node);
136 evas_canvas3d_node_position_set(-20.0, 20.0, 50.0),
137 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0,
138 EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
139 eo_do(data->root_node, evas_canvas3d_node_member_add(data->light_node));
140} 131}
141 132
142static void 133static void
@@ -147,95 +138,80 @@ _mesh_setup(Scene_Data *data)
147 138
148 data->texture_rocks = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 139 data->texture_rocks = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
149 data->texture_rocks_n = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 140 data->texture_rocks_n = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
150 eo_do(data->texture_rocks, evas_canvas3d_texture_file_set(rock_diffuse, NULL), 141 evas_canvas3d_texture_file_set(data->texture_rocks, rock_diffuse, NULL);
151 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 142 evas_canvas3d_texture_wrap_set(data->texture_rocks, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
152 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 143 evas_canvas3d_texture_file_set(data->texture_rocks_n, rock_n_and_height_map, NULL);
153 eo_do(data->texture_rocks_n, evas_canvas3d_texture_file_set(rock_n_and_height_map, NULL), 144 evas_canvas3d_texture_wrap_set(data->texture_rocks_n, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
154 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, 145
155 EVAS_CANVAS3D_WRAP_MODE_REPEAT)); 146 evas_canvas3d_material_texture_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_rocks_n);
156 147 evas_canvas3d_material_texture_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_rocks);
157 eo_do(data->material_rocks, 148 evas_canvas3d_material_texture_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, data->texture_rocks);
158 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_rocks_n), 149 evas_canvas3d_material_texture_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, data->texture_rocks);
159 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_rocks), 150 evas_canvas3d_material_enable_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
160 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, data->texture_rocks), 151 evas_canvas3d_material_enable_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
161 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, data->texture_rocks), 152 evas_canvas3d_material_enable_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
162 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 153 evas_canvas3d_material_enable_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
163 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 154 evas_canvas3d_material_color_set(data->material_rocks, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.1, 0.1, 0.1, 1.0);
164 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 155 evas_canvas3d_material_color_set(data->mat