Advertisement
Noah-Huppert

Aspect ratio rotation issue

Feb 9th, 2014
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. //Set X and Y with:
  2. /*
  3. * I iterate through every vertex of an entity
  4. * transformResults is the the std::vector<VERTEX> that holds the entities vertices after adding in regular transforms
  5. */
  6. float dRotation = Entity::rotation * (M_PI / 180);
  7. newVertX = cos(dRotation) * (transformResults.at(x).X - Entity::centerPoint.X) - sin(dRotation) * (transformResults.at(x).Y - Entity::centerPoint.Y) + Entity::centerPoint.X
  8.  
  9. newVertY = sin(dRotation) * (transformResults.at(x).X - Entity::centerPoint.X) + cos(dRotation) * (transformResults.at(x).Y - Entity::centerPoint.Y) + Entity::centerPoint.Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement