Код: Выделить всё
class Line {
public:
glm::vec3 start, direction;
}
struct Vertex {
glm::vec3 position;
glm::vec3 normal;
glm::vec2 text_coords;
};
class Object {
public:
vector vertic, vector indices; // load with help AssImp
glm::vec3 position, rotation, scale;
glm::mat4 getModel() {
glm::met4 model(1.0f);
model = glm::translate(this->mat, this->position);
model = glm::scale(this->mat, this->scale);
model = glm::rotate(this->mat, glm::radians(this->rotation.x), glm::vec3(1,0,0));
model = glm::rotate(this->mat, glm::radians(this->rotation.y), glm::vec3(0,1,0));
model = glm::rotate(this->mat, glm::radians(this->rotation.z), glm::vec3(0,0,1));
return model;
}
void Draw() {
glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0);
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... cts-on-map