void Cube::initCubeTexture() { QImage xpos("./bin/textures/room/xpos.png"); QImage xneg("./bin/textures/room/xneg.png"); QImage ypos("./bin/textures/room/ypos.png"); QImage yneg("./bin/textures/room/yneg.png"); QImage zpos("./bin/textures/room/zpos.png"); QImage zneg("./bin/textures/room/zneg.png"); int width = xpos.width(); int height = xpos.height(); glGenTextures(1, &m_texture); glBindTexture(GL_TEXTURE_CUBE_MAP, m_texture); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, xpos.bits()); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, xneg.bits()); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, ypos.bits()); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, yneg.bits()); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, zpos.bits()); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, zneg.bits()); glBindTexture(GL_TEXTURE_CUBE_MAP, 0); }
/** * \brief Default constructor */ SpecificWorker::SpecificWorker(MapPrx& mprx) : GenericWorker(mprx) { connect(ci, SIGNAL(clicked()), this, SLOT(moverpataci())); connect(cd, SIGNAL(clicked()), this, SLOT(moverpatacd())); connect(Xpos, SIGNAL(clicked()), this, SLOT(xpos())); connect(Xneg, SIGNAL(clicked()), this, SLOT(xneg())); connect(Ypos, SIGNAL(clicked()), this, SLOT(ypos())); connect(Yneg, SIGNAL(clicked()), this, SLOT(yneg())); connect(Zpos, SIGNAL(clicked()), this, SLOT(zpos())); connect(Zneg, SIGNAL(clicked()), this, SLOT(zneg())); connect(Actualizar, SIGNAL(clicked()), this, SLOT(actualizar())); inner = new InnerModel("/home/ivan/robocomp/files/innermodel/hexapod1pata.xml"); Posini=inner->transform("base","axisA1T"); Posfin=Posini; QVec aux=inner->transform("arm1motor2","arm1motor3"); qDebug()<<aux; angle1=atan(aux.y()/aux.z()); Femur=aux.norm2(); aux=inner->transform("arm1motor3","axisA1T"); angle2=atan(aux.y()/aux.z()); Tibia=aux.norm2(); qDebug()<<aux; Coxa=52; qDebug()<<"-----------------------------"; qDebug()<<" Coxa = "<<Coxa; qDebug()<<" Femur = "<<Femur; qDebug()<<" Tibia = "<<Tibia; qDebug()<<" angle1 = "<<angle1; qDebug()<<" angle2 = "<<angle2; qDebug()<<"-----------------------------"; // Femur=sqrt(14.5*14.5+64.5*64.5); // Tibia=sqrt(123.714*123.714+ 23.6179 *23.6179); H=18.5; // Posini=QVec::zeros(3); // RoboCompJointMotor::MotorParamsList mp = jointmotor_proxy->getAllMotorParams(); // RoboCompJointMotor::MotorGoalPositionList mg; // for(auto m:mp){ // cout<<m.name<<endl; // RoboCompJointMotor::MotorGoalPosition p; // p.name=m.name; // p.maxSpeed=0.1; // p.position=0; // mg.push_back(p); // // mg.insert(p); // } // jointmotor_proxy->setSyncPosition(mg); m1="arm1motor1"; m2="arm1motor2"; m3="arm1motor3"; }