summaryrefslogtreecommitdiff
path: root/src/examples/evas/shooter/evas-3d-shooter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/evas/shooter/evas-3d-shooter.c')
-rw-r--r--src/examples/evas/shooter/evas-3d-shooter.c527
1 files changed, 202 insertions, 325 deletions
diff --git a/src/examples/evas/shooter/evas-3d-shooter.c b/src/examples/evas/shooter/evas-3d-shooter.c
index fac65a3..9ea9ceb 100644
--- a/src/examples/evas/shooter/evas-3d-shooter.c
+++ b/src/examples/evas/shooter/evas-3d-shooter.c
@@ -115,8 +115,7 @@ _key_down(void *data,
115 { 115 {
116 if (space_move == 0.0) 116 if (space_move == 0.0)
117 { 117 {
118 eo_do(scene->mesh_node_tommy, 118 evas_canvas3d_node_position_get(scene->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
119 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
120 old_space_position = y; 119 old_space_position = y;
121 space_move = JUMP; 120 space_move = JUMP;
122 } 121 }
@@ -134,19 +133,15 @@ _key_down(void *data,
134 if (!scene->blending) 133 if (!scene->blending)
135 { 134 {
136 scene->blending = EINA_TRUE; 135 scene->blending = EINA_TRUE;
137 eo_do(scene->texture_diffuse_carpet, 136 evas_canvas3d_texture_file_set(scene->texture_diffuse_carpet, gazebo_t_trans_path, NULL);
138 evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL)); 137 evas_canvas3d_mesh_blending_enable_set(scene->mesh_carpet, EINA_TRUE);
139 eo_do(scene->mesh_carpet, 138 evas_canvas3d_mesh_blending_func_set(scene->mesh_carpet, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA);
140 evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
141 evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA));
142 } 139 }
143 else 140 else
144 { 141 {
145 scene->blending = EINA_FALSE; 142 scene->blending = EINA_FALSE;
146 eo_do(scene->texture_diffuse_carpet, 143 evas_canvas3d_texture_file_set(scene->texture_diffuse_carpet, gazebo_t_path, NULL);
147 evas_canvas3d_texture_file_set(gazebo_t_path, NULL)); 144 evas_canvas3d_mesh_blending_enable_set(scene->mesh_carpet, EINA_FALSE);
148 eo_do(scene->mesh_carpet,
149 evas_canvas3d_mesh_blending_enable_set(EINA_FALSE));
150 } 145 }
151 } 146 }
152 else if (!strcmp(ev->key, "S")) 147 else if (!strcmp(ev->key, "S"))
@@ -154,14 +149,12 @@ _key_down(void *data,
154 if (!scene->blending) 149 if (!scene->blending)
155 { 150 {
156 scene->blending = EINA_TRUE; 151 scene->blending = EINA_TRUE;
157 eo_do(global_scene, 152 evas_canvas3d_scene_shadows_enable_set(global_scene, EINA_TRUE);
158 evas_canvas3d_scene_shadows_enable_set(EINA_TRUE));
159 } 153 }
160 else 154 else
161 { 155 {
162 scene->blending = EINA_FALSE; 156 scene->blending = EINA_FALSE;
163 eo_do(global_scene, 157 evas_canvas3d_scene_shadows_enable_set(global_scene, EINA_FALSE);
164 evas_canvas3d_scene_shadows_enable_set(EINA_FALSE));
165 } 158 }
166 } 159 }
167 else if (!strcmp(ev->key, "F")) 160 else if (!strcmp(ev->key, "F"))
@@ -257,13 +250,11 @@ _key_down(void *data,
257 } 250 }
258 } 251 }
259 else if (!strcmp(ev->key, "F1")) 252 else if (!strcmp(ev->key, "F1"))
260 eo_do(scene->camera_node, 253 evas_canvas3d_node_position_set(scene->camera_node, 0.0, 80.0, 30.0);
261 evas_canvas3d_node_position_set(0.0, 80.0, 30.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);
262 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));
263 else if (!strcmp(ev->key, "F2")) 255 else if (!strcmp(ev->key, "F2"))
264 eo_do(scene->camera_node, 256 evas_canvas3d_node_position_set(scene->camera_node, -2.0, 0.0, 4.0);
265 evas_canvas3d_node_position_set(-2.0, 0.0, 4.0), 257 evas_canvas3d_node_look_at_set(scene->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -100.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
266 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, -100.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0));
267 else if (!strcmp(ev->key, "A")) 258 else if (!strcmp(ev->key, "A"))
268 aabb_index++; 259 aabb_index++;
269} 260}
@@ -308,27 +299,22 @@ _animate_camera(void *data)
308 x_move_lateral = camera_move * sin((angle_camera + 90) * TO_RADIAN); 299 x_move_lateral = camera_move * sin((angle_camera + 90) * TO_RADIAN);
309 z_move_lateral = camera_move * cos((angle_camera + 90) * TO_RADIAN); 300 z_move_lateral = camera_move * cos((angle_camera + 90) * TO_RADIAN);
310 301
311 eo_do(scene->mediator_node, 302 evas_canvas3d_node_position_get(scene->mediator_node, EVAS_CANVAS3D_SPACE_WORLD, &x, &y, &z);
312 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_WORLD, &x, &y, &z));
313 303
314 eo_do(scene->mesh_node_world, 304 evas_canvas3d_node_position_get(scene->mesh_node_world, EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1);
315 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1));
316 305
317 eo_do(scene->mesh_node_tommy, 306 evas_canvas3d_node_position_get(scene->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2);
318 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2));
319 307
320 if (fall_speed != 0) 308 if (fall_speed != 0)
321 { 309 {
322 if (y - fall_speed < 0) 310 if (y - fall_speed < 0)
323 { 311 {
324 eo_do(scene->mediator_node, 312 evas_canvas3d_node_position_set(scene->mediator_node, x, 0, z);
325 evas_canvas3d_node_position_set(x, 0, z));
326 fall_speed = 0.0; 313 fall_speed = 0.0;
327 } 314 }
328 else 315 else
329 { 316 {
330 eo_do(scene->mediator_node, 317 evas_canvas3d_node_position_set(scene->mediator_node, x, y - fall_speed, z);
331 evas_canvas3d_node_position_set(x, y - fall_speed, z));
332 fall_speed += FALL_SPEED_UP; 318 fall_speed += FALL_SPEED_UP;
333 } 319 }
334 } 320 }
@@ -354,10 +340,8 @@ _animate_camera(void *data)
354 _horizontal_circle_position_resolution(scene->mesh_node_column[2], x + x_move, z + z_move, SOLDIER_RADIUS) && 340 _horizontal_circle_position_resolution(scene->mesh_node_column[2], x + x_move, z + z_move, SOLDIER_RADIUS) &&
355 _horizontal_circle_position_resolution(scene->mesh_node_column[3], x + x_move, z + z_move, SOLDIER_RADIUS)) 341 _horizontal_circle_position_resolution(scene->mesh_node_column[3], x + x_move, z + z_move, SOLDIER_RADIUS))
356 { 342 {
357 eo_do(scene->mediator_node, 343 evas_canvas3d_node_position_set(scene->mediator_node, x + x_move, y, z + z_move);
358 evas_canvas3d_node_position_set(x + x_move, y, z + z_move)); 344 evas_canvas3d_node_position_set(scene->mesh_node_world, x1 + x_move, y1, z1 + z_move);
359 eo_do(scene->mesh_node_world,
360 evas_canvas3d_node_position_set(x1 + x_move, y1, z1 + z_move));
361 } 345 }
362 } 346 }
363 else if ((SOLDIER_FRAME_X1 < x + x_move_lateral) && (x + x_move_lateral < SOLDIER_FRAME_X2) && 347 else if ((SOLDIER_FRAME_X1 < x + x_move_lateral) && (x + x_move_lateral < SOLDIER_FRAME_X2) &&
@@ -381,27 +365,22 @@ _animate_camera(void *data)
381 _horizontal_circle_position_resolution(scene->mesh_node_column[2], x + x_move_lateral, z + z_move_lateral, SOLDIER_RADIUS) && 365 _horizontal_circle_position_resolution(scene->mesh_node_column[2], x + x_move_lateral, z + z_move_lateral, SOLDIER_RADIUS) &&
382 _horizontal_circle_position_resolution(scene->mesh_node_column[3], x + x_move_lateral, z + z_move_lateral, SOLDIER_RADIUS)) 366 _horizontal_circle_position_resolution(scene->mesh_node_column[3], x + x_move_lateral, z + z_move_lateral, SOLDIER_RADIUS))
383 { 367 {
384 eo_do(scene->mediator_node, 368 evas_canvas3d_node_position_set(scene->mediator_node, x + x_move_lateral, y, z + z_move_lateral);
385 evas_canvas3d_node_position_set(x + x_move_lateral, y, z + z_move_lateral)); 369 evas_canvas3d_node_position_set(scene->mesh_node_world, x1 + x_move_lateral, y1, z1 + z_move_lateral);
386 eo_do(scene->mesh_node_world,
387 evas_canvas3d_node_position_set(x1 + x_move_lateral, y1, z1 + z_move_lateral));
388 } 370 }
389 } 371 }
390 372
391 eo_do(scene->mediator_node, 373 evas_canvas3d_node_position_get(scene->mediator_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
392 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
393 374
394 if (!_horizontal_position_resolution(scene->mesh_node_level[step_indicator+1], x, z)) 375 if (!_horizontal_position_resolution(scene->mesh_node_level[step_indicator+1], x, z))
395 { 376 {
396 eo_do(scene->mediator_node, 377 evas_canvas3d_node_position_set(scene->mediator_node, x, y + STEP, z);
397 evas_canvas3d_node_position_set(x, y + STEP, z));
398 old_space_position += STEP; 378 old_space_position += STEP;
399 step_indicator++; 379 step_indicator++;
400 } 380 }
401 else if (!_horizontal_position_resolution(scene->mesh_node_level[step_indicator-1], x, z) && step_indicator > 0) 381 else if (!_horizontal_position_resolution(scene->mesh_node_level[step_indicator-1], x, z) && step_indicator > 0)
402 { 382 {
403 eo_do(scene->mediator_node, 383 evas_canvas3d_node_position_set(scene->mediator_node, x, y - STEP, z);
404 evas_canvas3d_node_position_set(x, y - STEP, z));
405 old_space_position -= STEP; 384 old_space_position -= STEP;
406 step_indicator--; 385 step_indicator--;
407 } 386 }
@@ -411,14 +390,11 @@ _animate_camera(void *data)
411 step_indicator = 0; 390 step_indicator = 0;
412 } 391 }
413 392
414 eo_do(scene->mediator_node, 393 evas_canvas3d_node_orientation_angle_axis_set(scene->mediator_node, angle_camera, 0, 1.0, 0.0);
415 evas_canvas3d_node_orientation_angle_axis_set(angle_camera, 0, 1.0, 0.0), 394 evas_canvas3d_node_position_get(scene->mediator_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
416 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
417 395
418 eo_do(scene->mesh_node_warrior, 396 evas_canvas3d_node_position_get(scene->mesh_node_warrior, EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1);
419 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1)); 397 evas_canvas3d_node_position_get(scene->mesh_node_snake, EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2);
420 eo_do(scene->mesh_node_snake,
421 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2));
422 398
423 float snake_x = (x2 - x) / _distance(x, z, x2, z2); 399 float snake_x = (x2 - x) / _distance(x, z, x2, z2);
424 float snake_z = (z2 - z) / _distance(x, z, x2, z2); 400 float snake_z = (z2 - z) / _distance(x, z, x2, z2);
@@ -432,11 +408,9 @@ _animate_camera(void *data)
432 _horizontal_circle_object_resolution(scene->mesh_node_warrior, scene->mesh_node_column[2], COLUMN_RADIUS) && 408 _horizontal_circle_object_resolution(scene->mesh_node_warrior, scene->mesh_node_column[2], COLUMN_RADIUS) &&
433 _horizontal_circle_object_resolution(scene->mesh_node_warrior, scene->mesh_node_column[3], COLUMN_RADIUS) && 409 _horizontal_circle_object_resolution(scene->mesh_node_warrior, scene->mesh_node_column[3], COLUMN_RADIUS) &&
434 _horizontal_circle_object_resolution(scene->mesh_node_level[0], scene->mesh_node_warrior, COLUMN_RADIUS)) 410 _horizontal_circle_object_resolution(scene->mesh_node_level[0], scene->mesh_node_warrior, COLUMN_RADIUS))
435 eo_do(scene->mesh_node_warrior, 411 evas_canvas3d_node_position_set(scene->mesh_node_warrior, (x - x1) * WARRIOR_SPEED + x1, y1, (z - z1) * WARRIOR_SPEED + z1);
436 evas_canvas3d_node_position_set((x - x1) * WARRIOR_SPEED + x1, y1, (z - z1) * WARRIOR_SPEED + z1));
437 else 412 else
438 eo_do(scene->mesh_node_warrior, 413 evas_canvas3d_node_position_set(scene->mesh_node_warrior, (z - z1) * WARRIOR_SPEED2 + x1, y1, -(x - x1) * WARRIOR_SPEED2 + z1);
439 evas_canvas3d_node_position_set((z - z1) * WARRIOR_SPEED2 + x1, y1, -(x - x1) * WARRIOR_SPEED2 + z1));
440 } 414 }
441 415
442 /* if soldier is looking at the snake */ 416 /* if soldier is looking at the snake */
@@ -447,44 +421,34 @@ _animate_camera(void *data)
447 { 421 {
448 if ((_horizontal_object_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1, 422 if ((_horizontal_object_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1,
449 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, snake_z * SNAKE_SPEED, -snake_x * SNAKE_SPEED))) 423 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, snake_z * SNAKE_SPEED, -snake_x * SNAKE_SPEED)))
450 eo_do(scene->mesh_node_snake, 424 evas_canvas3d_node_position_set(scene->mesh_node_snake, snake_z * SNAKE_SPEED + x2, y2, -snake_x * SNAKE_SPEED + z2);
451 evas_canvas3d_node_position_set(snake_z * SNAKE_SPEED + x2, y2, -snake_x * SNAKE_SPEED + z2));
452 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x, 425 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x,
453 (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS)) 426 (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS))
454 eo_do(scene->mesh_node_snake, 427 evas_canvas3d_node_position_set(scene->mesh_node_snake, (x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2);
455 evas_canvas3d_node_position_set((x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2));
456 } 428 }
457 /* if snake is located at the right hand of the soldier */ 429 /* if snake is located at the right hand of the soldier */
458 else 430 else
459 { 431 {
460 if ((_horizontal_object_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1, 432 if ((_horizontal_object_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1,
461 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, -snake_z * SNAKE_SPEED, snake_x * SNAKE_SPEED))) 433 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, -snake_z * SNAKE_SPEED, snake_x * SNAKE_SPEED)))
462 eo_do(scene->mesh_node_snake, 434 evas_canvas3d_node_position_set(scene->mesh_node_snake, -snake_z * SNAKE_SPEED + x2, y2, snake_x * SNAKE_SPEED + z2);
463 evas_canvas3d_node_position_set(-snake_z * SNAKE_SPEED + x2, y2, snake_x * SNAKE_SPEED + z2));
464 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x, 435 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x,
465 (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS)) 436 (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS))
466 eo_do(scene->mesh_node_snake, 437 evas_canvas3d_node_position_set(scene->mesh_node_snake, (x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2);
467 evas_canvas3d_node_position_set((x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2));
468 } 438 }
469 } 439 }
470 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x, (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS)) 440 else if (_horizontal_circle_resolution(scene->mesh_node_snake, (x2 - x) * SNAKE_SPEED2 + x, (z2 - z) * SNAKE_SPEED2 + z, SOLDIER_RADIUS))
471 eo_do(scene->mesh_node_snake, 441 evas_canvas3d_node_position_set(scene->mesh_node_snake, (x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2);
472 evas_canvas3d_node_position_set((x - x2) * SNAKE_SPEED2 + x2, y2, (z - z2) * SNAKE_SPEED2 + z2));
473 442
474 eo_do(scene->mesh_node_snake, 443 evas_canvas3d_node_position_get(scene->mesh_node_snake, EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2);
475 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x2, &y2, &z2));
476 444
477 eo_do(scene->mesh_node_warrior, 445 evas_canvas3d_node_look_at_set(scene->mesh_node_warrior, EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, (z - z1) / _distance(x, z, x1, z1), 0, (x1 - x) / _distance(x, z, x1, z1));
478 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT,
479 (z - z1) / _distance(x, z, x1, z1), 0, (x1 - x) / _distance(x, z, x1, z1)));
480 446
481 eo_do(scene->mesh_node_snake, 447 evas_canvas3d_node_look_at_set(scene->mesh_node_snake, EVAS_CANVAS3D_SPACE_PARENT, 2 * x2 - x, y2, 2 * z2 - z, EVAS_CANVAS3D_SPACE_PARENT, 0, 1, 0);
482 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 2 * x2 - x, y2, 2 * z2 - z, EVAS_CANVAS3D_SPACE_PARENT, 0, 1, 0));
483 448
484 if (!_horizontal_frame_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1, 449 if (!_horizontal_frame_resolution(scene->mesh_node_snake, SNAKE_FRAME_X1, SNAKE_FRAME_Z1,
485 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, &x_move, &z_move)) 450 SNAKE_FRAME_X2, SNAKE_FRAME_Z2, &x_move, &z_move))
486 eo_do(scene->mesh_node_snake, 451 evas_canvas3d_node_position_set(scene->mesh_node_snake, x2 + x_move, y2, z2 + z_move);
487 evas_canvas3d_node_position_set(x2 + x_move, y2, z2 + z_move));
488 452
489 return EINA_TRUE; 453 return EINA_TRUE;
490} 454}
@@ -509,22 +473,18 @@ _animate_scene_gun(void *data)
509 /* rocket and gun movement */ 473 /* rocket and gun movement */
510 angle_eagle += d_angle_eagle; 474 angle_eagle += d_angle_eagle;
511 475
512 eo_do(scene->mesh_node_eagle, 476 frame_eagle = evas_canvas3d_node_mesh_frame_get(scene->mesh_node_eagle, scene->mesh_eagle);
513 frame_eagle = evas_canvas3d_node_mesh_frame_get(scene->mesh_eagle));
514 if (frame_eagle > 19500) frame_eagle = 0; 477 if (frame_eagle > 19500) frame_eagle = 0;
515 frame_eagle += 150; 478 frame_eagle += 150;
516 479
517 eo_do(scene->mesh_node_snake, 480 frame_snake = evas_canvas3d_node_mesh_frame_get(scene->mesh_node_snake, scene->mesh_snake);
518 frame_snake = evas_canvas3d_node_mesh_frame_get(scene->mesh_snake));
519 if (frame_snake > 16000) frame_snake = 0; 481 if (frame_snake > 16000) frame_snake = 0;
520 frame_snake += 64; 482 frame_snake += 64;
521 483
522 eo_do(scene->mesh_node_eagle, 484 evas_canvas3d_node_orientation_angle_axis_set(scene->mesh_node_eagle, angle_eagle, 0.0, 1.0, 0.0);
523 evas_canvas3d_node_orientation_angle_axis_set(angle_eagle, 0.0, 1.0, 0.0), 485 /* equation of eagle flight */
524 /* equation of eagle flight */ 486 evas_canvas3d_node_position_set(scene->mesh_node_eagle, 38 * sin((angle_eagle + 90) * TO_RADIAN), 20 + 20 * sin(angle_eagle * TO_RADIAN), -10 + 20.0 * cos((angle_eagle + 90) * TO_RADIAN));
525 evas_canvas3d_node_position_set(38 * sin((angle_eagle + 90) * TO_RADIAN), 20 + 20 * sin(angle_eagle * TO_RADIAN), 487 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_eagle, scene->mesh_eagle, frame_eagle);
526 -10 + 20.0 * cos((angle_eagle + 90) * TO_RADIAN)),
527 evas_canvas3d_node_mesh_frame_set(scene->mesh_eagle, frame_eagle));
528 488
529 for (i = 0; i < 10; i ++) 489 for (i = 0; i < 10; i ++)
530 { 490 {
@@ -536,15 +496,13 @@ _animate_scene_gun(void *data)
536 else if (rocket_indicator[i] == 1) 496 else if (rocket_indicator[i] == 1)
537 { 497 {
538 _scale(scene->mesh_node_rocket[i], 0.4); 498 _scale(scene->mesh_node_rocket[i], 0.4);
539 eo_do(scene->material_rocket[i], 499 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0);
540 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0), 500 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.2, 0.2, 0.0, 1.0);
541 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.2, 0.2, 0.0, 1.0), 501 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0);
542 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0));
543 502
544 rocket_indicator[i] = 2; 503 rocket_indicator[i] = 2;
545 504
546 eo_do(scene->mesh_node_rocket[i], 505 evas_canvas3d_node_position_set(scene->mesh_node_rocket[i], ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z);
547 evas_canvas3d_node_position_set(ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z));
548 rocket_parametr[i] = 0; 506 rocket_parametr[i] = 0;
549 } 507 }
550 else if (rocket_indicator[i] == 2) 508 else if (rocket_indicator[i] == 2)
@@ -552,33 +510,27 @@ _animate_scene_gun(void *data)
552 rocket_parametr[i] += ROCKET_SPEED; 510 rocket_parametr[i] += ROCKET_SPEED;
553 /* equation of rocket flight */ 511 /* equation of rocket flight */
554 512
555 eo_do(scene->mesh_node_rocket[i], 513 evas_canvas3d_node_position_get(scene->mesh_node_rocket[i], EVAS_CANVAS3D_SPACE_WORLD, &x, &y, &z);
556 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_WORLD, &x, &y, &z));
557 514
558 if ((ROCKET_FRAME_X1 < x) && (x < ROCKET_FRAME_X2) && (ROCKET_FRAME_Z1 < z) && (z < ROCKET_FRAME_Z2)) 515 if ((ROCKET_FRAME_X1 < x) && (x < ROCKET_FRAME_X2) && (ROCKET_FRAME_Z1 < z) && (z < ROCKET_FRAME_Z2))
559 eo_do(scene->mesh_node_rocket[i], 516 evas_canvas3d_node_position_set(scene->mesh_node_rocket[i], ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z - rocket_parametr[i]);
560 evas_canvas3d_node_position_set(ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z - rocket_parametr[i]));
561 else 517 else
562 rocket_indicator[i] = 3; 518 rocket_indicator[i] = 3;
563 519
564 /* the way to stop the rocket */ 520 /* the way to stop the rocket */
565 eo_do(scene->mesh_node_warrior, 521 evas_canvas3d_node_bounding_box_get(scene->mesh_node_warrior, &x, &y, &z, &x1, &y1, &z1);
566 evas_canvas3d_node_bounding_box_get(&x, &y, &z, &x1, &y1, &z1));
567 evas_box3_set(&boxy, x, y, z, x1, y1, z1); 522 evas_box3_set(&boxy, x, y, z, x1, y1, z1);
568 523
569 eo_do(scene->mesh_node_rocket[i], 524 evas_canvas3d_node_position_get(scene->mesh_node_rocket[i], EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
570 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
571 525
572 eo_do(scene->mediator_node, 526 evas_canvas3d_node_position_get(scene->mediator_node, EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1);
573 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x1, &y1, &z1));
574 527
575 if (((z * sinus + x * cosinus + x1) >= boxy.p0.x) && ((z * sinus + x * cosinus + x1) <= boxy.p1.x) && 528 if (((z * sinus + x * cosinus + x1) >= boxy.p0.x) && ((z * sinus + x * cosinus + x1) <= boxy.p1.x) &&
576 ((z * cosinus - x * sinus + z1) >= boxy.p0.z) && ((z * cosinus - x * sinus + z1) <= boxy.p1.z)) 529 ((z * cosinus - x * sinus + z1) >= boxy.p0.z) && ((z * cosinus - x * sinus + z1) <= boxy.p1.z))
577 { 530 {
578 eo_do(scene->material_rocket[i], 531 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0);
579 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0), 532 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.9, 0.1, 0.1, 1.0);
580 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.9, 0.1, 0.1, 1.0), 533 evas_canvas3d_material_color_set(scene->material_rocket[i], EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0);
581 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0));
582 534
583 _scale(scene->mesh_node_rocket[i], 4.5); 535 _scale(scene->mesh_node_rocket[i], 4.5);
584 rocket_indicator[i] = 3; 536 rocket_indicator[i] = 3;
@@ -589,18 +541,14 @@ _animate_scene_gun(void *data)
589 if (tommy_indicator == 1) 541 if (tommy_indicator == 1)
590 { 542 {
591 tommy_indicator = 2; 543 tommy_indicator = 2;
592 eo_do(scene->mesh_node_tommy, 544 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z);
593 evas_canvas3d_node_position_set(TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z));
594 tommy_parametr = 0.0; 545 tommy_parametr = 0.0;
595 } 546 }
596 /* parametric equations of gun movement, (GUN_DIR_X, GUN_DIR_Y, GUN_DIR_Z) is direction vector */ 547 /* parametric equations of gun movement, (GUN_DIR_X, GUN_DIR_Y, GUN_DIR_Z) is direction vector */
597 else if (tommy_indicator == 2) 548 else if (tommy_indicator == 2)
598 { 549 {
599 tommy_parametr += GUN_SPEED; 550 tommy_parametr += GUN_SPEED;
600 eo_do(scene->mesh_node_tommy, 551 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_POS_X + GUN_DIR_X * tommy_parametr, TOMMY_POS_Y + GUN_DIR_Y * tommy_parametr, TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr);
601 evas_canvas3d_node_position_set(TOMMY_POS_X + GUN_DIR_X * tommy_parametr,
602 TOMMY_POS_Y + GUN_DIR_Y * tommy_parametr,
603 TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr));
604 552
605 if (TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr >= -8.3) 553 if (TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr >= -8.3)
606 tommy_indicator = 3; 554 tommy_indicator = 3;
@@ -608,13 +556,9 @@ _animate_scene_gun(void *data)
608 else if (tommy_indicator == 3) 556 else if (tommy_indicator == 3)
609 { 557 {
610 tommy_parametr-= GUN_SPEED / 2; 558 tommy_parametr-= GUN_SPEED / 2;
611 eo_do(scene->mesh_node_tommy, 559 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_POS_X + GUN_DIR_X * tommy_parametr, TOMMY_POS_Y + GUN_DIR_Y * tommy_parametr, TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr);
612 evas_canvas3d_node_position_set(TOMMY_POS_X + GUN_DIR_X * tommy_parametr,
613 TOMMY_POS_Y + GUN_DIR_Y * tommy_parametr,
614 TOMMY_POS_Z + GUN_DIR_Z * tommy_parametr));
615 560
616 eo_do(scene->mesh_node_tommy, 561 evas_canvas3d_node_position_get(scene->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
617 evas_canvas3d_node_position_get(EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z));
618 if (z <= TOMMY_POS_Z) 562 if (z <= TOMMY_POS_Z)
619 { 563 {
620 tommy_indicator = 4; 564 tommy_indicator = 4;
@@ -624,59 +568,44 @@ _animate_scene_gun(void *data)
624 568
625 if (angle_eagle > 360.0) angle -= 360.0f; 569 if (angle_eagle > 360.0) angle -= 360.0f;
626 570
627 eo_do(scene->mesh_node_warrior, 571 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_warrior, scene->mesh_warrior, frame);
628 evas_canvas3d_node_mesh_frame_set(scene->mesh_warrior, frame));
629 572
630 eo_do(scene->mesh_node_snake, 573 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_snake, scene->mesh_snake, frame_snake);
631 evas_canvas3d_node_mesh_frame_set(scene->mesh_snake, frame_snake));
632 574
633 if (space_move && (soldier_mode == 0)) 575 if (space_move && (soldier_mode == 0))
634 { 576 {
635 eo_do(scene->mesh_node_soldier, 577 evas_canvas3d_node_mesh_add(scene->mesh_node_soldier, scene->mesh_soldier_jump);
636 evas_canvas3d_node_mesh_add(scene->mesh_soldier_jump), 578 evas_canvas3d_node_mesh_del(scene->mesh_node_soldier, scene->mesh_soldier);
637 evas_canvas3d_node_mesh_del(scene->mesh_soldier), 579 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_soldier, scene->mesh_soldier_jump, 0);
638 evas_canvas3d_node_mesh_frame_set(scene->mesh_soldier_jump, 0));
639 soldier_mode = 1; 580 soldier_mode = 1;
640 eo_do(scene->mesh_node_tommy, 581 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_JUMP_X, TOMMY_JUMP_Y, TOMMY_JUMP_Z);
641 evas_canvas3d_node_position_set(TOMMY_JUMP_X, TOMMY_JUMP_Y, TOMMY_JUMP_Z), 582 evas_canvas3d_node_look_at_set(scene->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, 1000.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0, 0, 1);
642 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 1000.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT,
643 0, 0, 1));
644 } 583 }
645 else if (soldier_mode == 1) 584 else if (soldier_mode == 1)
646 { 585 {
647 eo_do(scene->mesh_node_soldier, 586 frame_soldier = evas_canvas3d_node_mesh_frame_get(scene->mesh_node_soldier, scene->mesh_soldier_jump);
648 frame_soldier = evas_canvas3d_node_mesh_frame_get(scene->mesh_soldier_jump));
649 frame_soldier += 124; 587 frame_soldier += 124;
650 eo_do(scene->mesh_node_soldier, 588 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_soldier, scene->mesh_soldier_jump, frame_soldier);
651 evas_canvas3d_node_mesh_frame_set(scene->mesh_soldier_jump, frame_soldier));
652 if (frame_soldier < 2480) 589 if (frame_soldier < 2480)
653 eo_do(scene->mesh_node_tommy, 590 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_JUMP_X, TOMMY_JUMP_Y + 4.5 * frame_soldier / 2480, TOMMY_JUMP_Z);
654 evas_canvas3d_node_position_set(TOMMY_JUMP_X, TOMMY_JUMP_Y + 4.5 * frame_soldier / 2480, TOMMY_JUMP_Z));
655 else 591 else
656 eo_do(scene->mesh_node_tommy, 592 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_JUMP_X, TOMMY_JUMP_Y + 4.5 * (4960 - frame_soldier) / 2480, TOMMY_JUMP_Z);
657 evas_canvas3d_node_position_set(TOMMY_JUMP_X, TOMMY_JUMP_Y + 4.5 * (4960 - frame_soldier) / 2480, TOMMY_JUMP_Z));
658 if (frame_soldier > 4960) 593 if (frame_soldier > 4960)
659 { 594 {
660 eo_do(scene->mesh_node_soldier, 595 evas_canvas3d_node_mesh_del(scene->mesh_node_soldier, scene->mesh_soldier_jump);
661 evas_canvas3d_node_mesh_del(scene->mesh_soldier_jump)); 596 evas_canvas3d_node_mesh_add(scene->mesh_node_soldier, scene->mesh_soldier);
662 eo_do(scene->mesh_node_soldier, 597 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_soldier, scene->mesh_soldier, 0);
663 evas_canvas3d_node_mesh_add(scene->mesh_soldier),
664 evas_canvas3d_node_mesh_frame_set(scene->mesh_soldier, 0));
665 soldier_mode = 0; 598 soldier_mode = 0;
666 eo_do(scene->mesh_node_tommy, 599 evas_canvas3d_node_position_set(scene->mesh_node_tommy, TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z);
667 evas_canvas3d_node_position_set(TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z), 600 evas_canvas3d_node_look_at_set(scene->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 2, 0, 1.5);
668 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0,
669 EVAS_CANVAS3D_SPACE_PARENT, 2, 0, 1.5));
670 } 601 }
671 } 602 }
672 else if (camera_move) 603 else if (camera_move)
673 { 604 {
674 eo_do(scene->mesh_node_soldier, 605 frame_soldier = evas_canvas3d_node_mesh_frame_get(scene->mesh_node_soldier, scene->mesh_soldier);
675 frame_soldier = evas_canvas3d_node_mesh_frame_get(scene->mesh_soldier));
676 frame_soldier += 124; 606 frame_soldier += 124;
677 if (frame_soldier > 6200) frame_soldier = 0; 607 if (frame_soldier > 6200) frame_soldier = 0;
678 eo_do(scene->mesh_node_soldier, 608 evas_canvas3d_node_mesh_frame_set(scene->mesh_node_soldier, scene->mesh_soldier, frame_soldier);
679 evas_canvas3d_node_mesh_frame_set(scene->mesh_soldier, frame_soldier));
680 } 609 }
681 610
682 /* create bounding box */ 611 /* create bounding box */
@@ -723,8 +652,7 @@ _reload_camera(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, voi
723 Evas_Canvas3D_Mesh *m; 652 Evas_Canvas3D_Mesh *m;
724 Evas_Real s, t; 653 Evas_Real s, t;
725 654
726 eo_do(global_scene, 655 evas_canvas3d_scene_pick(global_scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
727 evas_canvas3d_scene_pick(ev->canvas.x, ev->canvas.y, &n, &m, &s, &t));
728 656
729 d_angle_camera = 0; 657 d_angle_camera = 0;
730 if (n || m) 658 if (n || m)
@@ -772,14 +700,12 @@ _mesh_setup_gun_planet(Scene_Data *data)
772 /* Setup material and texture for world. */ 700 /* Setup material and texture for world. */
773 701
774 ADD_MESH(world, world, 0.5, 0.5, 1.0); 702 ADD_MESH(world, world, 0.5, 0.5, 1.0);
775 eo_do(data->mesh_world, 703 evas_canvas3d_mesh_from_primitive_set(data->mesh_world, 0, data->sphere_primitive);
776 evas_canvas3d_mesh_from_primitive_set(0, data->sphere_primitive));
777 SETUP_DEFAULT_MESH(world, world, DIFFUSE); 704 SETUP_DEFAULT_MESH(world, world, DIFFUSE);
778 SETUP_MESH_NODE(world); 705 SETUP_MESH_NODE(world);
779 706
780 eo_do(data->mesh_node_world, 707 evas_canvas3d_node_scale_set(data->mesh_node_world, 350, 350, 350);
781 evas_canvas3d_node_scale_set(350, 350, 350), 708 evas_canvas3d_node_position_set(data->mesh_node_world, 0.0, 0.0, 0.0);
782 evas_canvas3d_node_position_set(0.0, 0.0, 0.0));
783 709
784 /* Setup material and texture for player */ 710 /* Setup material and texture for player */
785 711
@@ -788,14 +714,11 @@ _mesh_setup_gun_planet(Scene_Data *data)
788 714
789 SETUP_MESH_NODE(soldier) 715 SETUP_MESH_NODE(soldier)
790 716
791 eo_do(data->mesh_node_soldier, 717 evas_canvas3d_node_position_set(data->mesh_node_soldier, 0, -10, 0);
792 evas_canvas3d_node_position_set(0, -10, 0), 718 evas_canvas3d_node_scale_set(data->mesh_node_soldier, 5, 5, 5);
793 evas_canvas3d_node_scale_set(5, 5, 5));
794 719
795 eo_do(data->mesh_node_soldier, 720 evas_canvas3d_node_look_at_set(data->mesh_node_soldier, EVAS_CANVAS3D_SPACE_PARENT, 0.0, -10.0, -100.0, EVAS_CANVAS3D_SPACE_PARENT, 0, 1, 0);
796 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, -10.0, -100.0, EVAS_CANVAS3D_SPACE_PARENT, 721 evas_canvas3d_node_mesh_frame_set(data->mesh_node_soldier, data->mesh_soldier, 0);
797 0, 1, 0),
798 evas_canvas3d_node_mesh_frame_set(data->mesh_soldier, 0));
799 722
800 ADD_MESH(soldier, soldier_jump, 1.0, 1.0, 1.0) 723 ADD_MESH(soldier, soldier_jump, 1.0, 1.0, 1.0)
801 MATERIAL_TEXTURE_SET(soldier, soldier_jump, soldier_jump_path, soldier_tex_path) 724 MATERIAL_TEXTURE_SET(soldier, soldier_jump, soldier_jump_path, soldier_tex_path)
@@ -804,17 +727,14 @@ _mesh_setup_gun_planet(Scene_Data *data)
804 727
805 ADD_MESH(tommy, tommy, 0.0, 0.3, 1.0) 728 ADD_MESH(tommy, tommy, 0.0, 0.3, 1.0)
806 SETUP_MESH_NODE(tommy) 729 SETUP_MESH_NODE(tommy)
807 eo_do(data->mesh_tommy, 730 efl_file_set(data->mesh_tommy, gun_path, NULL);
808 efl_file_set(gun_path, NULL), 731 efl_file_save(data->mesh_tommy, "try.obj", NULL, NULL);
809 efl_file_save("try.obj", NULL, NULL), 732 evas_canvas3d_mesh_shade_mode_set(data->mesh_tommy, EVAS_CANVAS3D_SHADE_MODE_PHONG);
810 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 733 evas_canvas3d_mesh_frame_material_set(data->mesh_tommy, 0, data->material_tommy);
811 evas_canvas3d_mesh_frame_material_set(0, data->material_tommy)); 734
812 735 evas_canvas3d_node_scale_set(data->mesh_node_tommy, 1.5, 1.5, 1.5);
813 eo_do(data->mesh_node_tommy, 736 evas_canvas3d_node_position_set(data->mesh_node_tommy, TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z);
814 evas_canvas3d_node_scale_set(1.5, 1.5, 1.5), 737 evas_canvas3d_node_look_at_set(data->mesh_node_tommy, EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 2, 0, 1.5);
815 evas_canvas3d_node_position_set(TOMMY_POS_X, TOMMY_POS_Y, TOMMY_POS_Z),
816 evas_canvas3d_node_look_at_set(EVAS_CANVAS3D_SPACE_PARENT, 0.0, -1000.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT,
817 2, 0, 1.5));
818 738
819 /* Setup material and texture for gazebo */ 739 /* Setup material and texture for gazebo */
820 740
@@ -823,10 +743,9 @@ _mesh_setup_gun_planet(Scene_Data *data)
823 MATERIAL_TEXTURE_SET(gazebo, gazebo, gazebo_bot_path, gazebo_b_path) 743 MATERIAL_TEXTURE_SET(gazebo, gazebo, gazebo_bot_path, gazebo_b_path)
824 NORMAL_SET(gazebo, gazebo, gazebo_b_n_path) 744 NORMAL_SET(gazebo, gazebo, gazebo_b_n_path)
825 745
826 eo_do(data->mesh_node_gazebo, 746 evas_canvas3d_node_scale_set(data->mesh_node_gazebo, 0.18, 0.18, 0.18);
827 evas_canvas3d_node_scale_set(0.18, 0.18, 0.18), 747 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_gazebo, 180, 0.0, 1.0, 0.0);
828 evas_canvas3d_node_orientation_angle_axis_set(180, 0.0, 1.0, 0.0), 748 evas_canvas3d_node_position_set(data->mesh_node_gazebo, -20, -10, -35);
829 evas_canvas3d_node_position_set(-20, -10, -35));
830 749
831 /* Setup material and texture for carpet */ 750 /* Setup material and texture for carpet */
832 751
@@ -837,38 +756,32 @@ _mesh_setup_gun_planet(Scene_Data *data)
837 756
838 if (data->blending) 757 if (data->blending)
839 { 758 {
840 eo_do(data->texture_diffuse_carpet, 759 evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_carpet, EINA_FALSE);
841 evas_canvas3d_texture_atlas_enable_set(EINA_FALSE), 760 evas_canvas3d_texture_file_set(data->texture_diffuse_carpet, gazebo_t_trans_path, NULL);
842 evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL)); 761 evas_canvas3d_mesh_blending_enable_set(data->mesh_carpet, EINA_TRUE);
843 eo_do(data->mesh_carpet, 762 evas_canvas3d_mesh_blending_func_set(data->mesh_carpet, EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA);
844 evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
845 evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA));
846 } 763 }
847 764
848 eo_do(data->mesh_node_carpet, 765 evas_canvas3d_node_scale_set(data->mesh_node_carpet, 0.18, 0.18, 0.18);
849 evas_canvas3d_node_scale_set(0.18, 0.18, 0.18), 766 evas_canvas3d_node_position_set(data->mesh_node_carpet, -20, -10, -35);
850 evas_canvas3d_node_position_set(-20, -10, -35));
851 /* Setup material and texture for eagle. */ 767 /* Setup material and texture for eagle. */
852 768
853 ADD_MESH(eagle, eagle, 0.01, 1.0, 1.0) 769 ADD_MESH(eagle, eagle, 0.01, 1.0, 1.0)
854 SETUP_MESH_NODE(eagle) 770 SETUP_MESH_NODE(eagle)
855 MATERIAL_TEXTURE_SET(eagle, eagle, eagle_path, eagle_tex_path) 771 MATERIAL_TEXTURE_SET(eagle, eagle, eagle_path, eagle_tex_path)
856 772
857 eo_do(data->mesh_node_eagle, 773 evas_canvas3d_node_scale_set(data->mesh_node_eagle, 0.1, 0.1, 0.1);
858 evas_canvas3d_node_scale_set(0.1, 0.1, 0.1), 774 evas_canvas3d_node_position_set(data->mesh_node_eagle, -20, 20, 0);
859 evas_canvas3d_node_position_set(-20, 20, 0));
860 /* Set material for bounding box */ 775 /* Set material for bounding box */
861 776
862 ADD_MESH(cube, cube, 0.01, 1.0, 1.0) 777 ADD_MESH(cube, cube, 0.01, 1.0, 1.0)
863 eo_do(data->mesh_cube, evas_canvas3d_mesh_frame_add(0)); 778 evas_canvas3d_mesh_frame_add(data->mesh_cube, 0);
864 SETUP_DEFAULT_MESH(cube, cube, DIFFUSE); 779 SETUP_DEFAULT_MESH(cube, cube, DIFFUSE);
865 SETUP_MESH_NODE(cube) 780 SETUP_MESH_NODE(cube)
866 781
867 eo_do(data->mesh_cube, 782 evas_canvas3d_mesh_index_data_set(data->mesh_cube, EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 36, &cube_indices[0]);
868 evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 783 evas_canvas3d_mesh_vertex_count_set(data->mesh_cube, 24);
869 36, &cube_indices[0]), 784 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_cube, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
870 evas_canvas3d_mesh_vertex_count_set(24),
871 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES));
872 785
873 /* Setup mesh for column carpet */ 786 /* Setup mesh for column carpet */
874 787
@@ -878,30 +791,27 @@ _mesh_setup_gun_planet(Scene_Data *data)
878 CUBE_TEXTURE_SET(column_c, column_c, cube_textcoords, red_brick_path) 791 CUBE_TEXTURE_SET(column_c, column_c, cube_textcoords, red_brick_path)
879 NORMAL_SET(column_c, column_c, red_brick_n_path) 792 NORMAL_SET(column_c, column_c, red_brick_n_path)
880 793
881 eo_do(data->mesh_node_column_c, 794 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_column_c, 90, 0, 1.0, 0.0);
882 evas_canvas3d_node_orientation_angle_axis_set(90, 0, 1.0, 0.0), 795 evas_canvas3d_node_scale_set(data->mesh_node_column_c, 96.0, 1.6, 4.8);
883 evas_canvas3d_node_scale_set(96.0, 1.6 , 4.8 ), 796 evas_canvas3d_node_position_set(data->mesh_node_column_c, 10, 9.0, -12);
884 evas_canvas3d_node_position_set(10 , 9.0, -12));
885 797
886 /* Setup mesh for bounding sphere */ 798 /* Setup mesh for bounding sphere */
887 data->material_ball = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 799 data->material_ball = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
888 eo_do(data->material_ball, 800 evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
889 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 801 evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
890 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 802 evas_canvas3d_material_enable_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
891 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 803 evas_canvas3d_material_color_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 1.0, 1.0, 1.0);
892 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 1.0, 1.0, 1.0), 804 evas_canvas3d_material_color_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 5.0, 1.0, 1.0);
893 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 5.0, 1.0, 1.0), 805 evas_canvas3d_material_color_set(data->material_ball, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
894 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 806 evas_canvas3d_material_shininess_set(data->material_ball, 50.0);
895 evas_canvas3d_material_shininess_set(50.0));
896 807
897 data->mesh_ball = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 808 data->mesh_ball = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
898 809
899 _set_ball(data->mesh_ball, 10); 810 _set_ball(data->mesh_ball, 10);
900 811
901 eo_do(data->mesh_ball, 812 evas_canvas3d_mesh_shade_mode_set(data->mesh_ball, EVAS_CANVAS3D_SHADE_MODE_DIFFUSE);
902 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE), 813 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_ball, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
903 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES), 814 evas_canvas3d_mesh_frame_material_set(data->mesh_ball, 0, data->material_ball);
904 evas_canvas3d_mesh_frame_material_set(0, data->material_ball));
905 815
906 SETUP_MESH_NODE(ball) 816 SETUP_MESH_NODE(ball)
907 817
@@ -921,26 +831,22 @@ _mesh_setup_wall(Scene_Data *data, int index)
921 831
922 /* placing of wall carpet on the floor grid */ 832 /* placing of wall carpet on the floor grid */
923 if (index == 0) 833 if (index == 0)
924 eo_do(data->mesh_node_wall[index], 834 evas_canvas3d_node_scale_set(data->mesh_node_wall[index], 6.7 * 19.5, 20.0, 2.0);
925 evas_canvas3d_node_scale_set(6.7 * 19.5, 20.0, 2.0), 835 evas_canvas3d_node_position_set(data->mesh_node_wall[index], -39.7 + 18.6 * 3, 0.0, -60.3);
926 evas_canvas3d_node_position_set(-39.7 + 18.6 * 3, 0.0, -60.3));
927 else if (index == 1) 836 else if (index == 1)
928 { 837 {
929 eo_do(data->mesh_node_wall[index], 838 evas_canvas3d_node_scale_set(data->mesh_node_wall[index], 5 * 19.5, 20.0, 2.0);
930 evas_canvas3d_node_scale_set(5 * 19.5, 20.0, 2.0), 839 evas_canvas3d_node_position_set(data->mesh_node_wall[index], 81.2, 0.0, -51.5 + 19.5 * 2);
931 evas_canvas3d_node_position_set(81.2, 0.0, -51.5 + 19.5 * 2), 840 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_wall[index], 90, 0, 1.0, 0.0);
932 evas_canvas3d_node_orientation_angle_axis_set(90, 0, 1.0, 0.0));
933 } 841 }
934 else if (index == 2) 842 else if (index == 2)
935 eo_do(data->mesh_node_wall[index], 843 evas_canvas3d_node_scale_set(data->mesh_node_wall[index], 6.7 * 19.5, 20.0, 2.0);
936 evas_canvas3d_node_scale_set(6.7 * 19.5, 20.0, 2.0), 844 evas_canvas3d_node_position_set(data->mesh_node_wall[index], -39.7 + 18.6*3, 0.0, 35.3);
937 evas_canvas3d_node_position_set(-39.7 + 18.6*3, 0.0, 35.3));
938 else if (index == 3) 845 else if (index == 3)
939 { 846 {
940 eo_do(data->mesh_node_wall[index], 847 evas_canvas3d_node_scale_set(data->mesh_node_wall[index], 5* 19.5, 20.0, 2.0);
941 evas_canvas3d_node_scale_set(5* 19.5, 20.0, 2.0), 848 evas_canvas3d_node_position_set(data->mesh_node_wall[index], -48.4, 0.0, -51.5 + 19.5 * 2);
942 evas_canvas3d_node_position_set(-48.4, 0.0, -51.5 + 19.5 * 2), 849 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_wall[index], 90, 0, 1.0, 0.0);
943 evas_canvas3d_node_orientation_angle_axis_set(90, 0, 1.0, 0.0));
944 } 850 }
945} 851}
946 852
@@ -951,48 +857,40 @@ _mesh_setup_column(Scene_Data *data, int index)
951 857
952 data->material_column = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); 858 data->material_column = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
953 859
954 eo_do(data->material_column, 860 evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE);
955 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), 861 evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
956 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), 862 evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
957 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), 863 evas_canvas3d_material_enable_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
958 evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), 864 evas_canvas3d_material_color_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.4, 0.4, 0.4, 1.0);
959 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.4, 0.4, 0.4, 1.0), 865 evas_canvas3d_material_color_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.6, 0.6, 0.6, 1.0);
960 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.6, 0.6, 0.6, 1.0), 866 evas_canvas3d_material_color_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
961 evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0), 867 evas_canvas3d_material_shininess_set(data->material_column, 50.0);
962 evas_canvas3d_material_shininess_set(50.0));
963 868
964 data->mesh_column[index] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas); 869 data->mesh_column[index] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
965 870
966 SETUP_MESH_NODE(column[index]) 871 SETUP_MESH_NODE(column[index])
967 872
968 eo_do(data->mesh_column[index], 873 evas_canvas3d_mesh_from_primitive_set(data->mesh_column[index], 0, data->cylinder_primitive);
969 evas_canvas3d_mesh_from_primitive_set(0, data->cylinder_primitive), 874 evas_canvas3d_mesh_shade_mode_set(data->mesh_column[index], EVAS_CANVAS3D_SHADE_MODE_DIFFUSE);
970 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE), 875 evas_canvas3d_mesh_vertex_assembly_set(data->mesh_column[index], EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES);
971 evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES), 876 evas_canvas3d_mesh_shade_mode_set(data->mesh_column[index], EVAS_CANVAS3D_SHADE_MODE_PHONG);
972 evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG), 877 evas_canvas3d_mesh_frame_material_set(data->mesh_column[index], 0, data->material_column);
973 evas_canvas3d_mesh_frame_material_set(0, data->material_column));
974 878
975 data->texture_diffuse_column = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); 879 data->texture_diffuse_column = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
976 880
977 eo_do(data->texture_diffuse_column, 881 evas_canvas3d_texture_file_set(data->texture_diffuse_column, red_brick_path, NULL);
978 evas_canvas3d_texture_file_set(red_brick_path, NULL), 882 evas_canvas3d_texture_atlas_enable_set(data->texture_diffuse_column, EINA_FALSE);
979 evas_canvas3d_texture_atlas_enable_set(EINA_FALSE), 883 evas_canvas3d_texture_filter_set(data->texture_diffuse_column, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST);
980 evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST, 884 evas_canvas3d_texture_wrap_set(data->texture_diffuse_column, EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT);
981 EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST),
982 evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT));
983 885
984 eo_do(data->material_column, 886 evas_canvas3d_material_texture_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_diffuse_column);
985 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 887 evas_canvas3d_material_texture_set(data->material_column, EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, data->texture_diffuse_column);
986 data->texture_diffuse_column),
987 evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
988 data->texture_diffuse_column));
989 888
990 NORMAL_SET(column, column[index], red_brick_n_path) 889 NORMAL_SET(column, column[index], red_brick_n_path)
991 890
992 eo_do(data->mesh_node_column[index], 891 evas_canvas3d_node_scale_set(data->mesh_node_column[index], 2.2, 2.2, 19.0);
993 evas_canvas3d_node_scale_set(2.2, 2.2, 19.0), 892 evas_canvas3d_node_position_set(data->mesh_node_column[index], 10, 0, -45 + 21.25 * index);
994 evas_canvas3d_node_position_set(10 , 0, -45 + 21.25 * index), 893 evas_canvas3d_node_orientation_angle_axis_set(data->mesh_node_column[index], 90, 1.0, 0.0, 0.0);
995 evas_canvas3d_node_orientation_angle_axis_set(90, 1.0, 0.0, 0.0));
996} 894}
997 895
998void 896void
@@ -1007,9 +905,8 @@ _mesh_setup_grass(Scene_Data *data)
1007 NORMAL_SET(grass, grass, gray_brick_n_path) 905 NORMAL_SET(grass, grass, gray_brick_n_path)
1008 906
1009 /* placing of grass carpet on the floor grid */ 907 /* placing of grass carpet on the floor grid */
1010 eo_do(data->mesh_node_grass, 908 evas_canvas3d_node_scale_set(data->mesh_node_grass, 130.0, 1.0, 96.0);
1011 evas_canvas3d_node_scale_set(130.0, 1.0, 96.0), 909 evas_canvas3d_node_position_set(data->mesh_node_grass, 16.5, -10.0, -12);
1012 evas_canvas3d_node_position_set(16.5, -10.0, -12));
1013} 910}
1014 911
1015void 912void
@@ -1024,9 +921,8 @@ _mesh_setup(Scene_Data *data, float h EINA_UNUSED, float w EINA_UNUSED, float d
1024 CUBE_TEXTURE_SET(level[0], level[index], isource, red_brick_path) 921 CUBE_TEXTURE_SET(level[0], level[index], isource, red_brick_path)
1025 NORMAL_SET(level[0], level[index], red_brick_n_path) 922 NORMAL_SET(level[0], level[index], red_brick_n_path)
1026 923
1027 eo_do(data->mesh_node_level[index], 924 evas_canvas3d_node_scale_set(data->mesh_node_level[index], 19.5, 20.0, 2.0);
1028 evas_canvas3d_node_scale_set(19.5, 20.0, 2.0), 925 evas_canvas3d_node_position_set(data->mesh_node_level[index], 50, 0, -15);
1029 evas_canvas3d_node_position_set(50, 0, -15));
1030 } 926 }
1031 else 927 else
1032 { 928 {
@@ -1035,9 +931,8 @@ _mesh_setup(Scene_Data *data, float h EINA_UNUSED, float w EINA_UNUSED, float d
1035 CUBE_TEXTURE_SET(level[1], level[index], isource, gray_brick_path) 931 CUBE_TEXTURE_SET(level[1], level[index], isource, gray_brick_path)
1036 NORMAL_SET(level[1], level[index], gray_brick_n_path) 932 NORMAL_SET(level[1], level[index], gray_brick_n_path)
1037 933
1038 eo_do(data->mesh_node_level[index], 934 evas_canvas3d_node_scale_set(data->mesh_node_level[index], 2.0, 2.0, 8.0);
1039 evas_canvas3d_node_scale_set(2.0, 2.0, 8.0), 935 evas_canvas3d_node_position_set(data->mesh_node_level[index], 40 + (2 * index), -10 + (2 * index), -10);
1040 evas_canvas3d_node_position_set(40 + (2 * index), -10 + (2 * index), -10));
1041 } 936 }
1042} 937}
1043 938
@@ -1050,9 +945,8 @@ _mesh_setup_warrior(Scene_Data *data)
1050 SETUP_MESH_NODE(warrior) 945 SETUP_MESH_NODE(warrior)
1051 MATERIAL_TEXTURE_SET(warrior, warrior, warrior_path, warrior_tex_path) 946 MATERIAL_TEXTURE_SET(warrior, warrior, warrior_path, warrior_tex_path)
1052 947
1053 eo_do(data->mesh_node_warrior, 948 evas_canvas3d_node_position_set(data->mesh_node_warrior, 57, -10, 0);
1054 evas_canvas3d_node_position_set(57, -10, 0), 949 evas_canvas3d_node_scale_set(data->mesh_node_warrior, 0.15, 0.15, 0.15);
1055 evas_canvas3d_node_scale_set(0.15, 0.15, 0.15));
1056} 950}
1057 951
1058void 952void
@@ -1063,23 +957,20 @@ _mesh_setup_snake(Scene_Data *data)
1063 MATERIAL_TEXTURE_SET(snake, snake, snake_path, snake_tex_path) 957 MATERIAL_TEXTURE_SET(snake, snake, snake_path, snake_tex_path)
1064 NORMAL_SET(snake, snake, snake_tex_n_path) 958 NORMAL_SET(snake, snake, snake_tex_n_path)
1065 959
1066 eo_do(data->mesh_node_snake, 960 evas_canvas3d_node_position_set(data->mesh_node_snake, 20, -10, 20);
1067 evas_canvas3d_node_position_set(20, -10, 20), 961 evas_canvas3d_node_scale_set(data->mesh_node_snake, 4.0, 4.0, 4.0);
1068 evas_canvas3d_node_scale_set(4.0, 4.0, 4.0));
1069} 962}
1070 963
1071void 964void
1072_mesh_setup_rocket(Scene_Data *data, int index) 965_mesh_setup_rocket(Scene_Data *data, int index)
1073{ 966{
1074 ADD_MESH(rocket[index], rocket[index], 0.8, 0.2, 0.5); 967 ADD_MESH(rocket[index], rocket[index], 0.8, 0.2, 0.5);
1075 eo_do(data->mesh_rocket[index], 968 evas_canvas3d_mesh_from_primitive_set(data->mesh_rocket[index], 0, data->sphere_primitive);
1076 evas_canvas3d_mesh_from_primitive_set(0, data->sphere_primitive));
1077 SETUP_DEFAULT_MESH(rocket[index], rocket[index], DIFFUSE); 969 SETUP_DEFAULT_MESH(rocket[index], rocket[index], DIFFUSE);
1078 SETUP_MESH_NODE(rocket[index]); 970 SETUP_MESH_NODE(rocket[index]);
1079 971
1080 eo_do(data->mesh_node_rocket[index], 972 evas_canvas3d_node_scale_set(data->mesh_node_rocket[index], 1, 1, 1);
1081 evas_canvas3d_node_scale_set(1, 1, 1), 973 evas_canvas3d_node_position_set(data->mesh_node_rocket[index], ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z);
1082 evas_canvas3d_node_position_set(ROCKET_POS_X, ROCKET_POS_Y, ROCKET_POS_Z));
1083} 974}
1084 975
1085void 976void
@@ -1091,23 +982,19 @@ _scene_setup(Scene_Data *data)
1091 motion_vec[i] = 0; 982 motion_vec[i] = 0;
1092 983
1093 data->cube_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 984 data->cube_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
1094 eo_do(data->cube_primitive, 985 evas_canvas3d_primitive_form_set(data->cube_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE);
1095 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE), 986 evas_canvas3d_primitive_precision_set(data->cube_primitive, 10);
1096 evas_canvas3d_primitive_precision_set(10));
1097 987
1098 data->sphere_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 988 data->sphere_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
1099 eo_do(data->sphere_primitive, 989 evas_canvas3d_primitive_form_set(data->sphere_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE);
1100 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE), 990 evas_canvas3d_primitive_precision_set(data->sphere_primitive, 50);
1101 evas_canvas3d_primitive_precision_set(50));
1102 991
1103 global_scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas); 992 global_scene = eo_add(EVAS_CANVAS3D_SCENE_CLASS, evas);
1104 993
1105 eo_do(global_scene, 994 evas_canvas3d_scene_size_set(global_scene, WIDTH, HEIGHT);
1106 evas_canvas3d_scene_size_set(WIDTH, HEIGHT), 995 evas_canvas3d_scene_background_color_set(global_scene, 0.5, 0.5, 0.9, 0.0);
1107 evas_canvas3d_scene_background_color_set(0.5, 0.5, 0.9, 0.0));
1108 996
1109 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 997 data->root_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_NODE));
1110 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_NODE));
1111 998
1112 _camera_setup(data); 999 _camera_setup(data);
1113 _light_setup(data); 1000 _light_setup(data);
@@ -1118,11 +1005,10 @@ _scene_setup(Scene_Data *data)
1118 _mesh_setup_rocket(data, i); 1005 _mesh_setup_rocket(data, i);
1119 1006
1120 data->cylinder_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas); 1007 data->cylinder_primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
1121 eo_do(data->cylinder_primitive, 1008 evas_canvas3d_primitive_mode_set(data->cylinder_primitive, EVAS_CANVAS3D_PRIMITIVE_MODE_WITHOUT_BASE);
1122 evas_canvas3d_primitive_mode_set(EVAS_CANVAS3D_PRIMITIVE_MODE_WITHOUT_BASE), 1009 evas_canvas3d_primitive_form_set(data->cylinder_primitive, EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER);
1123 evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER), 1010 evas_canvas3d_primitive_tex_scale_set(data->cylinder_primitive, 1.0, 1.0);
1124 evas_canvas3d_primitive_tex_scale_set(1.0, 1.0), 1011 evas_canvas3d_primitive_precision_set(data->cylinder_primitive, 50);
1125 evas_canvas3d_primitive_precision_set(50));
1126 1012
1127 for ( i = 0; i < 4; i++) 1013 for ( i = 0; i < 4; i++)
1128 _mesh_setup_column(data, i); 1014 _mesh_setup_column(data, i);
@@ -1143,12 +1029,11 @@ _scene_setup(Scene_Data *data)
1143 1029
1144 _mesh_aabb(&data->mesh_cube, data, aabb_index); 1030 _mesh_aabb(&data->mesh_cube, data, aabb_index);
1145 1031
1146 eo_do(global_scene, 1032 evas_canvas3d_scene_root_node_set(global_scene, data->root_node);
1147 evas_canvas3d_scene_root_node_set(data->root_node), 1033 evas_canvas3d_scene_camera_node_set(global_scene, data->camera_node);
1148 evas_canvas3d_scene_camera_node_set(data->camera_node));
1149 1034
1150 if (data->shadow) 1035 if (data->shadow)
1151 eo_do(global_scene,evas_canvas3d_scene_shadows_enable_set(EINA_TRUE)); 1036 evas_canvas3d_scene_shadows_enable_set(global_scene, EINA_TRUE);
1152 1037
1153 if (data->fog) 1038 if (data->fog)
1154 { 1039 {
@@ -1174,40 +1059,33 @@ _scene_setup(Scene_Data *data)
1174 } 1059 }
1175 } 1060 }
1176 1061
1177 data->carp_mediator_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, 1062 data->carp_mediator_node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(eoid, EVAS_CANVAS3D_NODE_TYPE_MESH));
1178 evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
1179 1063
1180 eo_do(data->carp_mediator_node, 1064 evas_canvas3d_node_member_add(data->carp_mediator_node, data->mesh_node_carpet);
1181 evas_canvas3d_node_member_add(data->mesh_node_carpet));
1182 1065
1183 eo_do(data->mediator_node, 1066 evas_canvas3d_node_member_add(data->mediator_node, data->mesh_node_soldier);
1184 evas_canvas3d_node_member_add(data->mesh_node_soldier), 1067 evas_canvas3d_node_member_add(data->mediator_node, data->mesh_node_tommy);
1185 evas_canvas3d_node_member_add(data->mesh_node_tommy));
1186 1068
1187 for (i = 0; i < 10; i++) 1069 for (i = 0; i < 10; i++)
1188 eo_do(data->mediator_node, 1070 evas_canvas3d_node_member_add(data->mediator_node, data->mesh_node_rocket[i]);
1189 evas_canvas3d_node_member_add(data->mesh_node_rocket[i])); 1071
1190 1072 evas_canvas3d_node_member_add(data->root_node, data->carp_mediator_node);
1191 eo_do(data->root_node, 1073 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_world);
1192 evas_canvas3d_node_member_add(data->carp_mediator_node), 1074 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_gazebo);
1193 evas_canvas3d_node_member_add(data->mesh_node_world), 1075 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_eagle);
1194 evas_canvas3d_node_member_add(data->mesh_node_gazebo), 1076 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_cube);
1195 evas_canvas3d_node_member_add(data->mesh_node_eagle), 1077 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_column_c);
1196 evas_canvas3d_node_member_add(data->mesh_node_cube), 1078 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_ball);
1197 evas_canvas3d_node_member_add(data->mesh_node_column_c), 1079 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_grass);
1198 evas_canvas3d_node_member_add(data->mesh_node_ball), 1080 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_warrior);
1199 evas_canvas3d_node_member_add(data->mesh_node_grass), 1081 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_snake);
1200 evas_canvas3d_node_member_add(data->mesh_node_warrior),
1201 evas_canvas3d_node_member_add(data->mesh_node_snake));
1202 1082
1203 for (i = 0; i < 4; i++) 1083 for (i = 0; i < 4; i++)
1204 eo_do(data->root_node, 1084 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_wall[i]);
1205 evas_canvas3d_node_member_add(data->mesh_node_wall[i]), 1085 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_column[i]);
1206 evas_canvas3d_node_member_add(data->mesh_node_column[i]));
1207 1086
1208 for (i = 0; i < 10; i++) 1087 for (i = 0; i < 10; i++)
1209 eo_do(data->root_node, 1088 evas_canvas3d_node_member_add(data->root_node, data->mesh_node_level[i]);
1210 evas_canvas3d_node_member_add(data->mesh_node_level[i]));
1211} 1089}
1212 1090
1213int 1091int
@@ -1263,8 +1141,7 @@ main(int argc, char *argv[])
1263 evas_object_show(image); 1141 evas_object_show(image);
1264 1142
1265 /* Set the image object as render target for 3D scene. */ 1143 /* Set the image object as render target for 3D scene. */
1266 eo_do(image, 1144 evas_obj_image_scene_set(image, global_scene);
1267 evas_obj_image_scene_set(global_scene));
1268 1145
1269 evas_object_focus_set(image, EINA_TRUE); 1146 evas_object_focus_set(image, EINA_TRUE);
1270 1147