GeometryPositionColorOrientation

lab9-GeometryPositionColorOrientation

 

// Yaw/Pitch/Roll -> Rotation Matrix

glm::yawPitchRoll(yaw, pitch, roll) ;

float yaw,   // by y-axis (in radians)

float pitch,   // by x-axis (in radians)

float roll  // by z-axis (in radians)

 

//R1 != R2

glm::mat4 R1, R2, Rx, Ry, Rz;

Ry = glm::rotate(glm::mat4(1), 60, glm::vec3(0, 1, 0));

Rx = glm::rotate(glm::mat4(1), 30, glm::vec3(1, 0, 0));

Rz = glm::rotate(glm::mat4(1), 45, glm::vec3(0, 0, 1));

R1 = Ry * Rx * Rz;

R2 = glm::yawPitchRoll(60, 30, 45);