Is it possible to create function for those 4 fragments of code [closed]

  c++, opengl
//Planets
Object PLANET1(&Planet, &ModelShader);
PLANET1.model = &Planet;
PLANET1.transform.Dist_f_Parent = glm::vec2(14, 14);
PLANET1.setParent(&SUN);

Object PLANET2(&Sun_Moon, &ModelShader);
PLANET2.model = &Sun_Moon;
PLANET2.transform.e_x = 1;
PLANET2.transform.Dist_f_Parent = glm::vec2(28, 28);
PLANET2.setParent(&SUN);

Object PLANET3(&Planet, &ModelShader);
PLANET3.model = &Planet;
PLANET3.transform.e_x = -0.60;
PLANET3.transform.Dist_f_Parent = glm::vec2(42, 42);
PLANET3.setParent(&SUN);

Object PLANET4(&Sun_Moon, &ModelShader);
PLANET4.model = &Sun_Moon;
PLANET4.transform.e_x = 0.3;
PLANET4.transform.Dist_f_Parent = glm::vec2(56, 56);
PLANET4.setParent(&SUN);

So right now i am trying to somehow compile this mess into one function but i have no idea how to do this.

Source: Windows Questions C++

LEAVE A COMMENT