void loadMesh(const std::string &filename, Mesh *mesh) { OBJMesh obj_mesh; objMeshLoad(obj_mesh, filename); mesh->vertices = obj_mesh.vertices; mesh->normals = obj_mesh.normals; mesh->indices = obj_mesh.indices; }
/* * The ship object is loaded. */ void drawship(OBJMesh* mesh, GLOBAL_Translate* translateShip, GLOBAL_Rotate* rotateShip, GLOBAL_Scale* scaleShip, float colourShade[]) { glPushMatrix(); glTranslatef(translateShip->posX, translateShip->posY + SHIP_Y_POSITION_ON_WATER, translateShip->posZ); glRotatef(rotateShip->rotX, THIS, NOT_THIS, NOT_THIS); glRotatef(rotateShip->rotY, NOT_THIS, THIS, NOT_THIS); glRotatef(rotateShip->rotZ, NOT_THIS, NOT_THIS, THIS); glScalef(scaleShip->X, scaleShip->Y, scaleShip->Z); glColor3fv(colourShade); mesh = objMeshLoad("galleon.obj"); drawMesh(mesh); drawAxes(); glPopMatrix(); }