void FBXSceneImporter::read_node(FbxNode* pNode) { for (int i = 0; i < pNode->GetNodeAttributeCount(); i++) { FbxNodeAttribute* pAttribute = pNode->GetNodeAttributeByIndex(i); FbxNodeAttribute::EType attribute_type = pAttribute->GetAttributeType(); if (attribute_type == FbxNodeAttribute::eMesh) { FbxMesh* pMesh = (FbxMesh*)pAttribute; read_mesh(pNode, pMesh); } else if (attribute_type == FbxNodeAttribute::eLight) { FbxLight* pLight = (FbxLight*)pAttribute; read_light(pNode, pLight); } else if (attribute_type == FbxNodeAttribute::eCamera) { FbxCamera* pCamera = (FbxCamera*)pAttribute; read_camera(pNode, pCamera); } } int materialCount = pNode->GetSrcObjectCount<FbxSurfaceMaterial>(); // Recursively print the children. for (int j = 0; j < pNode->GetChildCount(); j++) { read_node(pNode->GetChild(j)); } }
void epuckPlayer() { //e_start_agendas_processing(); //e_init_motors(); //e_init_prox(); //e_init_uart1(); /* Must send anything here or it don't work. Is it a bug? */ e_send_uart1_char("epuckSide_v3.0", 14); unsigned a,b; /* Flash the LED's in a singular manner for show that this program is in * epuck memory */ for(a=0; a<8; a++) for(b=0; b<20000; b++) e_set_led(a ,1); /* LED ON */ for(a=0; a<8; a++) for(b=0; b<20000; b++) e_set_led(a ,0); /* LED OFF */ char command; while(1) { command = recv_char(); switch(command) { case 0x13: recv_vel(); break; case 0x14: send_steps(); break; case 0x16: read_ir_sensors(); break; case 0x15: stop_motors(); break; case 0x17: read_camera(); break; case 0x18: set_LEDs(); break; case 0x01: sendVersion(); break; case 0x02: config_camera(); break; } } }
void RayTracer::read_open_inventor_scene(std::string iv_file){ SoDB::init(); scene = new OSUInventorScene((char *)iv_file.c_str()); read_objects(); read_camera(); read_lights(); calculate_eye_coordinate_system(camera); calculate_image_dimentions(); return; }
void SDLReader::read_sdl(Scene &scene, string file_object, string file_camera, string file_light, string file_plane) { Camera *camera = read_camera(file_camera); scene.set_camera(camera); Material *material; Light *light = read_light(file_light, &material, scene); scene.add_light(light); Mesh *mesh = read_object(file_object, material); scene.add_mesh(mesh); if(file_plane.size() == 0) return; Plane *plane = read_plane(file_plane); scene.set_plane(plane); }
int main(int argc, char **argv) { int c = -1; int option_index; int img_height = DEFAULT_HEIGHT; int img_width = DEFAULT_WIDTH; int listen_port = LISTEN_PORT; for (;;) { c = getopt_long(argc, argv, short_options, long_options, &option_index); if (c == -1) { break; } switch(c) { case 'h': { if (optarg != NULL) { img_height = atoi(optarg); } break; }; case 'w': { if (optarg != NULL) { img_width = atoi(optarg); } break; }; case 'p': { if (optarg != NULL) { listen_port = atoi(optarg); } break; }; }; } if (open_socket(LISTEN_ADDR, listen_port) != 0) { printf("ERROR: cannot open socket\n"); return 1; } if (open_camera() != 0) { printf("Camera file error, exiting...\n"); return 1; } if (init_camera(img_height, img_width) != 0) { printf("Camera error, exiting...\n"); return 1; } else { printf("INFO: image size is %dx%d;\n\n", img_width, img_height); } while (1) { while (1) { if (wait_for_connect() == 0) { break; } } while (1) { if (read_current_socket() == 0) { if (check_get_params("exit") == 1) { goto APP_EXIT; } else if (check_get_params("bmp") == 1) { if (check_get_params(GETPARAM_SEND_HTTP_HEADERS)) { send(get_current_socket(), http_headers, strlen(http_headers), 0); send(get_current_socket(), header_ct_bmp, strlen(header_ct_bmp), 0); } read_camera(IMAGE_TYPE_BMP, get_current_socket(), check_get_params(GETPARAM_COLOR_IMAGE)); close_current_socket(); break; } else if (check_get_params("jpg") == 1) { //print_time(0); if (check_get_params(GETPARAM_SEND_HTTP_HEADERS)) { send(get_current_socket(), http_headers, strlen(http_headers), 0); send(get_current_socket(), header_ct_jpeg, strlen(header_ct_jpeg), 0); } read_camera(IMAGE_TYPE_JPG, get_current_socket(), check_get_params(GETPARAM_COLOR_IMAGE)); close_current_socket(); //print_time(1); break; } else if (check_get_params("yuyv") == 1) { // GET:yuyv read_camera(IMAGE_TYPE_YUYV, get_current_socket(), 0); close_current_socket(); break; } } } } APP_EXIT: printf("Exiting...\n"); close_camera(); close_current_socket(); close_main_socket(); return 0; }