Guest User

Untitled

a guest
Oct 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. glm::mat4 getTransform() {
  2. int timeSinceStart = glutGet(GLUT_ELAPSED_TIME);
  3. float t = 0.0001f * timeSinceStart;
  4.  
  5. t = t > 1.0f? 1.0f : t;
  6.  
  7. int segs = 8 -3;
  8. int seg = (int)(segs * t);
  9. seg = seg >= segs? segs-1 : seg;
  10. t = t * segs - seg;
  11. cout<<seg << " " << t << endl;
  12.  
  13. glm::vec4 tvec = glm::vec4(t * t * t, t * t, t, 1.0f) / 6.0f;
  14.  
  15. glm::mat4 b = glm::make_mat4(B);
  16. glm::mat4 trans = glm::mat4();
  17. memcpy(glm::value_ptr(trans), &r[seg], sizeof(glm::vec4) * 4);
  18.  
  19. glm::vec4 t2 = trans * b * tvec;
  20. return glm::translate(glm::mat4(0.25f), glm::vec3(t2));
  21. }
Add Comment
Please, Sign In to add comment