Guest User

Untitled

a guest
Feb 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. glTranslated(m_rotationCenter.x, 0, 0);
  2. glTranslated(0, m_rotationCenter.y, 0);
  3. glTranslated(0, 0, m_rotationCenter.z);
  4. glScalef( scale, scale, scale );
  5. glTranslated(-m_rotationCenter.x, 0, 0);
  6. glTranslated(0, -m_rotationCenter.y, 0);
  7. glTranslated(0, 0, -m_rotationCenter.z);
  8. glTranslated(m_rotationCenter.x-xTrans, 0, 0);
  9. glTranslated(0, m_rotationCenter.y+yTrans, 0);
  10. glTranslated(0, 0, m_rotationCenter.z+zTrans);
  11. glRotated( xRot, 1.0, 0.0, 0.0 );
  12. glRotated( yRot, 0.0, 1.0, 0.0 );
  13. glRotated( zRot, 0.0, 0.0, 1.0 );
  14. glTranslated(-m_rotationCenter.x+xTrans, 0, 0);
  15. glTranslated(0, -m_rotationCenter.y-yTrans, 0);
  16. glTranslated(0, 0, -m_rotationCenter.z-zTrans);
  17. glTranslated( -xTrans, 0.0, 0.0 );
  18. glTranslated( 0.0, yTrans, 0.0 );
  19. glTranslated( 0.0, 0.0, zTrans);
  20.  
  21. Vector3f bX = m_rotation.getAX() * m_scale.x;
  22. Vector3f bY = m_rotation.getAY() * m_scale.y;
  23. Vector3f bZ = m_rotation.getAZ() * m_scale.z;
  24. Vector3f orig = m_rotation.rotate(m_origin * m_scale);
  25. m_transform= Transform (
  26. Vector4f(bX.x, bX.y, bX.z, 0),
  27. Vector4f(bY.x, bY.y, bY.z, 0),
  28. Vector4f(bZ.x, bZ.y, bZ.z, 0),
  29. Vector4f(m_position.x - orig.x, m_position.y - orig.y, m_position.z - orig.z, 1)
  30. );
Add Comment
Please, Sign In to add comment